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
Return values
bool|nullgetAuthorizeRule()
protected
getAuthorizeRule(string $scope, string $action) : string
Parameters
- $scope : string
- $action : string
Return values
stringisAuthorizedAction()
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|nullisAuthorizedOverride()
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|nullisAuthorizedSuperAdmin()
protected
isAuthorizedSuperAdmin(UserInterface $user) : bool|null
Not needed for Flex Users.
Parameters
- $user : UserInterface