AccessController extends BaseAccessController
Table of Contents
Methods
- __construct() : mixed
- batchCheck() : array<string|int, mixed>
- can() : bool
- check() : bool
- Checking access rights by action
- checkByItemId() : bool
- checkByValue() : bool
- checkCompleteRight() : bool
- Returns true if user have full access to right <b>$action</b> or false otherwise
- getAllowedDefaultStoreId() : int|null
- Allowed default store id.
- getCurrent() : self
- getEntityFilter() : array<string|int, mixed>|null
- Get filter for entity.
- getInstance() : static
- getPermissionValue() : array<string|int, mixed>|int|null
- getUser() : AccessibleUser
- hasIblockAccess() : bool
- isAdmin() : mixed
Methods
__construct()
public
__construct(int $userId) : mixed
Parameters
- $userId : int
Tags
batchCheck()
public
batchCheck(array<string|int, mixed> $request, AccessibleItem $item) : array<string|int, mixed>
Parameters
- $request : array<string|int, mixed>
-
[ actionId => params ]
- $item : AccessibleItem
Tags
Return values
array<string|int, mixed> —[ actionId => true|false ]
can()
public
static can(mixed $userId, string $action[, mixed $itemId = null ][, mixed $params = null ]) : bool
Parameters
- $userId : mixed
- $action : string
- $itemId : mixed = null
- $params : mixed = null
Return values
boolcheck()
Checking access rights by action
public
check(string $action[, AccessibleItem|null $item = null ][, null $params = null ]) : bool
Parameters
- $action : string
- $item : AccessibleItem|null = null
- $params : null = null
Tags
Return values
boolcheckByItemId()
public
checkByItemId(string $action[, int $itemId = null ][, mixed $params = null ]) : bool
Parameters
- $action : string
- $itemId : int = null
- $params : mixed = null
Return values
boolcheckByValue()
public
checkByValue(string $action, string $value) : bool
Parameters
- $action : string
- $value : string
Return values
boolcheckCompleteRight()
Returns true if user have full access to right <b>$action</b> or false otherwise
public
checkCompleteRight(string $action) : bool
Parameters
- $action : string
Return values
boolgetAllowedDefaultStoreId()
Allowed default store id.
public
getAllowedDefaultStoreId() : int|null
If the default store is unavailable, the first available warehouse is returned.
Return values
int|null —returns null
if there is no access to any warehouse.
getCurrent()
public
static getCurrent() : self
Return values
selfgetEntityFilter()
Get filter for entity.
public
getEntityFilter(string $action, string $entityName[, mixed $params = null ]) : array<string|int, mixed>|null
Parameters
- $action : string
- $entityName : string
-
recommended to use the name of the tablet class.
- $params : mixed = null
Tags
Return values
array<string|int, mixed>|null —is filter not available - return null.
getInstance()
public
static getInstance(mixed $userId) : static
Parameters
- $userId : mixed
Return values
staticgetPermissionValue()
public
getPermissionValue(string $action) : array<string|int, mixed>|int|null
Parameters
- $action : string
Return values
array<string|int, mixed>|int|nullgetUser()
public
getUser() : AccessibleUser
Return values
AccessibleUserhasIblockAccess()
public
hasIblockAccess(string $action) : bool
Parameters
- $action : string
Return values
boolisAdmin()
public
isAdmin() : mixed