InheritedPermissions
class InheritedPermissions implements PermissionChecker, MemberCacheFlusher
Calculates batch permissions for nested objects for: - canView: Supports 'Anyone' type - canEdit - canDelete: Includes special logic for ensuring parent objects can only be deleted if their children can be deleted also.
Traits
Constants
DELETE |
Delete permission |
VIEW |
View permission |
EDIT |
Edit permission |
ANYONE |
Anyone canView permission |
LOGGED_IN_USERS |
Restrict to logged in users |
ONLY_THESE_USERS |
Restrict to specific groups |
INHERIT |
Inherit from parent |
Methods
An implementation of the factory method, allows you to create an instance of a class
Creates a class instance by the "singleton" design pattern.
Construct new permissions object
Commits the cache
Clear the cache for this instance only
Global permissions required to edit
No description
Get root permissions handler, or null if no handler
Get base class
Force pre-calculation of a list of permissions for optimisation
No description
Details
in Injectable at line 26
static Injectable
create(array $args)
An implementation of the factory method, allows you to create an instance of a class
This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.
This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create('SiteTree'); $list = SiteTree::get();
in Injectable at line 43
static Injectable
singleton(string $class = null)
Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
at line 100
__construct(string $baseClass, CacheInterface $cache = null)
Construct new permissions object
at line 115
__destruct()
Commits the cache
at line 132
flushMemberCache(array $memberIDs = null)
Clear the cache for this instance only
at line 157
$this
setDefaultPermissions(DefaultPermissionChecker $callback)
at line 169
$this
setGlobalEditPermissions(array $permissions)
Global permissions required to edit
at line 178
array
getGlobalEditPermissions()
at line 188
DefaultPermissionChecker|null
getDefaultPermissions()
Get root permissions handler, or null if no handler
at line 198
string
getBaseClass()
Get base class
at line 209
prePopulatePermissionCache(string $permission = 'edit', array $ids = [])
Force pre-calculation of a list of permissions for optimisation