Class \Prado\Security\Permissions\TUserPermissionsBehavior
TUserPermissionsBehavior class.
TUserPermissionsBehavior is designed to attach to TUser. This class adds can permissions functionality. It also handles dyDefaultRoles and dyIsInRole of TUser.
This passes through dyDefaultRoles and dyIsInRole to the TPermissionsManager.
Class hierarchy
- \Prado\Security\Permissions\TUserPermissionsBehavior uses TPermissionsManagerPropertyTrait
- \Prado\Util\TBehavior implements IBehavior
- \Prado\Util\TBaseBehavior implements IBaseBehavior uses TPriorityPropertyTrait
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 4.2.0
public
|
can(string $permission[, null|mixed $extraData = null ]) : mixed
Gets all the rules for the permission and checks against the TUser.
|
public
|
|
public
|
dyIsInRole(bool $return, string $role, TCallChain $callchain) : mixed
This handles the dynamic event where the $role does not match the user
roles. It checks the hierarchy of roles/permissions
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |