\PermissionService
A service interface to functionality related to getting and setting permission information for nodes
- Author: marcus@silverstripe.com.au
- License: BSD License http://silverstripe.org/bsd-license/
Synopsis
class PermissionService
{
- // constants
- const SOURCES_MAP = 'sources_map';
- const ITEM_PREFIX = 'perm_';
- // members
- protected Zend_Cache_Core $cache;
- protected array $parents = ;
- protected array $groups = ;
- protected $allPermissions;
- // methods
- public void __construct()
- public array webEnabledMethods()
- public Zend_Cache_Core getCache()
- public void getAllRoles()
- public void getPermissionDetails()
- public void allPermissions()
- public void flushCache()
- public void grantTo()
- public void removeAuthority()
- public void grant()
- public void checkRole()
- public void removePermissions()
- public type checkPerm()
- protected void sanitiseCacheData()
- public void checkPublicPerms()
- public void getEffectiveParents()
- public array getEffective()
- protected void parentFor()
- protected boolean checkOwnerPerms()
- public void getPermissionsFor()
- public void clearPermCacheFor()
- public void idStr()
- public void clearUserCachedPerms()
- public void purgePermissionCache()
- protected void clearSourcesCache()
- public string permCacheKey()
- public void realiseAllSources()
Constants
Name | Value |
---|---|
SOURCES_MAP | 'sources_map' |
ITEM_PREFIX | 'perm_' |
Members
protected
- $allPermissions
- $cache — Zend_Cache_Core
- $groups
- $parents
Methods
protected
- checkOwnerPerms() — Is the member the owner of this object, and is the permission being checked in the list of permissions that owners have?
- clearSourcesCache()
- parentFor()
- sanitiseCacheData()
public
- __construct()
- allPermissions()
- checkPerm() — Return true or false as to whether a given user can access an object
- checkPublicPerms() — Checks the permissions for a public user
- checkRole() — Check for the presence of ALL permissions in a given role for the user to an object
- clearPermCacheFor() — Clear any cached permissions for this object
- clearUserCachedPerms() — Clear all cached permissions for the given user
- flushCache()
- getAllRoles()
- getCache()
- getEffective()
- getEffectiveParents()
- getPermissionDetails()
- getPermissionsFor()
- grant() — Grants a specific permission to a given user or group
- grantTo() — Alternative grant method using group name or email address
- idStr()
- permCacheKey() — Get the key for this item in the cache
- purgePermissionCache()
- realiseAllSources() — Realise all parent sources of the given node
- removeAuthority() — Delete an authority
- removePermissions() — Removes a set of permissions applied on an object to a particular user/group
- webEnabledMethods() — Allow this service to be accessed from the web