Documentation

FlexAuthorizeTrait

Implements basic ACL

Table of Contents

Methods

isAuthorized()  : bool|null
Check if user is authorized for the action.
getAuthorizeRule()  : string
isAuthorizedAction()  : bool|null
Check if user is authorized for the action.
isAuthorizedOverride()  : bool|null
Please override this method
isAuthorizedSuperAdmin()  : bool|null

Methods

isAuthorized()

Check if user is authorized for the action.

public isAuthorized(string $action[, string|null $scope = null ][, UserInterface|null $user = null ]) : bool|null

Note: There are two deny values: denied (false), not set (null). This allows chaining multiple rules together when the previous rules were not matched.

To override the default behavior, please use isAuthorizedOverride().

Parameters
$action : string
$scope : string|null = null
$user : UserInterface|null = null
Tags
final
Return values
bool|null

getAuthorizeRule()

protected getAuthorizeRule(string $scope, string $action) : string
Parameters
$scope : string
$action : string
Return values
string

isAuthorizedAction()

Check if user is authorized for the action.

protected isAuthorizedAction(UserInterface $user, string $action, string $scope, bool $isMe) : bool|null
Parameters
$user : UserInterface
$action : string
$scope : string
$isMe : bool
Return values
bool|null

isAuthorizedOverride()

Please override this method

protected isAuthorizedOverride(UserInterface $user, string $action, string $scope, bool $isMe) : bool|null
Parameters
$user : UserInterface
$action : string
$scope : string
$isMe : bool
Return values
bool|null

        
On this page

Search results