Detailed Description
DefaultPermissionManager retrieves authorization rules the storage.
It is configured with an entity type that stores permissions and must have the values 'resource', 'context', 'action', 'roles'.
Definition at line 32 of file DefaultPermissionManager.php.
Public Member Functions | |
__construct (PersistenceFacade $persistenceFacade, Session $session) | |
setPermissionType ($permissionType) | |
getPermissions ($resource, $context, $action) | |
setPermissions ($resource, $context, $action, $permissions) | |
createPermission ($resource, $context, $action, $role, $modifier) | |
removePermission ($resource, $context, $action, $role) | |
Public Member Functions inherited from AbstractPermissionManager | |
__construct (PersistenceFacade $persistenceFacade, Session $session, array $dynamicRoles=[]) | |
setPrincipalFactory (PrincipalFactory $principalFactory) | |
authorize ($resource, $context, $action, $login=null, $applyDefaultPolicy=true) | |
addTempPermission ($resource, $context, $action) | |
removeTempPermission ($handle) | |
hasTempPermission ($resource, $context, $action) | |
clearTempPermissions () | |
Protected Member Functions | |
modifyPermission ($resource, $context, $action, $role, $modifier) | |
getPermissionInstance ($resource, $context, $action) | |
createPermissionObject ($resource, $context, $action, $roles) | |
Protected Member Functions inherited from AbstractPermissionManager | |
authorizeAction ($requestedResource, $permissionResource, $context, $action, $login) | |
getDefaultPolicy ($login) | |
parseResource ($resource) | |
deserializePermissions ($value) | |
serializePermissions ($permissions) | |
matchRoles ($resource, $permissions, $login) | |
matchRole (User $user, $role, $resource) | |
Additional Inherited Members | |
Public Attributes inherited from AbstractPermissionManager | |
const | RESOURCE_TYPE_ENTITY_TYPE = 'entity.type' |
const | RESOURCE_TYPE_ENTITY_TYPE_PROPERTY = 'entity.type.property' |
const | RESOURCE_TYPE_ENTITY_INSTANCE = 'entity.instance' |
const | RESOURCE_TYPE_ENTITY_INSTANCE_PROPERTY = 'entity.instance.property' |
const | RESOURCE_TYPE_OTHER = 'other' |
Public Attributes inherited from PermissionManager | |
const | PERMISSION_MODIFIER_ALLOW = '+' |
const | PERMISSION_MODIFIER_DENY = '-' |
Protected Attributes inherited from AbstractPermissionManager | |
$persistenceFacade = null | |
$session = null | |
$dynamicRoles = [] | |
$principalFactory = null | |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | PersistenceFacade | $persistenceFacade, |
Session | $session | ||
) |
Constructor.
- Parameters
-
$persistenceFacade $session
Definition at line 44 of file DefaultPermissionManager.php.
Member Function Documentation
◆ setPermissionType()
setPermissionType | ( | $permissionType | ) |
Set the entity type name of Permission instances.
- Parameters
-
$permissionType String
Definition at line 63 of file DefaultPermissionManager.php.
◆ getPermissions()
getPermissions | ( | $resource, | |
$context, | |||
$action | |||
) |
Implements PermissionManager.
Definition at line 71 of file DefaultPermissionManager.php.
◆ setPermissions()
setPermissions | ( | $resource, | |
$context, | |||
$action, | |||
$permissions | |||
) |
Implements PermissionManager.
Definition at line 86 of file DefaultPermissionManager.php.
◆ createPermission()
createPermission | ( | $resource, | |
$context, | |||
$action, | |||
$role, | |||
$modifier | |||
) |
Implements PermissionManager.
Definition at line 115 of file DefaultPermissionManager.php.
◆ removePermission()
removePermission | ( | $resource, | |
$context, | |||
$action, | |||
$role | |||
) |
Implements PermissionManager.
Definition at line 122 of file DefaultPermissionManager.php.
◆ modifyPermission()
|
protected |
Modify a permission for the given role.
- Parameters
-
$resource The resource (e.g. class name of the Controller or object id). $context The context in which the action takes place. $action The action to process. $role The role to authorize. $modifier One of the PERMISSION_MODIFIER_ constants, null, if the permission should be removed.
- Returns
- boolean
Definition at line 136 of file DefaultPermissionManager.php.
◆ getPermissionInstance()
|
protected |
Get the permission object that matches the given parameters.
- Parameters
-
$resource Resource $context Context $action Action
- Returns
- Instance of _permissionType or null
Definition at line 168 of file DefaultPermissionManager.php.
◆ createPermissionObject()
|
protected |
Create a permission object with the given parameters.
- Parameters
-
$resource Resource $context Context $action Action $roles String representing the permissions as returned from serializePermissions()
- Returns
- Instance of _permissionType
Definition at line 186 of file DefaultPermissionManager.php.