Heratio Framework API Reference

TrustLevelService
in package

Trust Level Service.

Manages user trust levels for access control.

Table of Contents

Methods

canDownload()  : bool
Check if user can download.
canViewRestricted()  : bool
Check if user can view restricted content.
create()  : int
Create a new trust level.
delete()  : bool
Delete trust level.
getAllLevels()  : Collection
Get all trust levels.
getByCode()  : object|null
Get trust level by code.
getById()  : object|null
Get trust level by ID.
getUserLevel()  : int
Get user's trust level numeric value.
getUserTrustLevel()  : object|null
Get user's effective trust level.
hasMinLevel()  : bool
Check if user has minimum trust level.
update()  : bool
Update trust level.

Methods

canDownload()

Check if user can download.

public canDownload(int $userId[, int|null $institutionId = null ]) : bool
Parameters
$userId : int
$institutionId : int|null = null
Return values
bool

canViewRestricted()

Check if user can view restricted content.

public canViewRestricted(int $userId[, int|null $institutionId = null ]) : bool
Parameters
$userId : int
$institutionId : int|null = null
Return values
bool

create()

Create a new trust level.

public create(array<string|int, mixed> $data) : int
Parameters
$data : array<string|int, mixed>
Return values
int

delete()

Delete trust level.

public delete(int $id) : bool
Parameters
$id : int
Return values
bool

getAllLevels()

Get all trust levels.

public getAllLevels() : Collection
Return values
Collection

getByCode()

Get trust level by code.

public getByCode(string $code) : object|null
Parameters
$code : string
Return values
object|null

getById()

Get trust level by ID.

public getById(int $id) : object|null
Parameters
$id : int
Return values
object|null

getUserLevel()

Get user's trust level numeric value.

public getUserLevel(int $userId[, int|null $institutionId = null ]) : int
Parameters
$userId : int
$institutionId : int|null = null
Return values
int

getUserTrustLevel()

Get user's effective trust level.

public getUserTrustLevel(int $userId[, int|null $institutionId = null ]) : object|null
Parameters
$userId : int
$institutionId : int|null = null
Return values
object|null

hasMinLevel()

Check if user has minimum trust level.

public hasMinLevel(int $userId, int $minLevel[, int|null $institutionId = null ]) : bool
Parameters
$userId : int
$minLevel : int
$institutionId : int|null = null
Return values
bool

update()

Update trust level.

public update(int $id, array<string|int, mixed> $data) : bool
Parameters
$id : int
$data : array<string|int, mixed>
Return values
bool

        
On this page

Search results