AnnotatePermissionChecker
in package
Class AnnotatePermissionChecker
Helperclass to check if the current environment, class or module is allowed to be annotated. This is abstracted from @see DataObjectAnnotator to separate and clean up.
Table of Contents
Properties
- $supportedParentClasses : mixed
- In the future we will support other Classes as well.
Methods
- classNameIsAllowed() : bool
- Check if a DataObject or DataExtension subclass is allowed by checking if the file is in the $allowed_modules array The permission is checked by matching the filePath and modulePath
- classNameIsSupported() : bool
- Check if a (subclass of ) class is a supported
- enabledModules() : array<string|int, mixed>
- environmentIsAllowed() : bool
- getSupportedParentClasses() : array<string|int, mixed>
- isEnabled() : bool
- moduleIsAllowed() : bool
- Check if a module is in the $allowed_modules array Required for the buildTask.
Properties
$supportedParentClasses
In the future we will support other Classes as well.
protected
mixed
$supportedParentClasses
= [\SilverStripe\ORM\DataObject::class, \SilverStripe\ORM\DataExtension::class, \SilverStripe\Control\Controller::class, \SilverStripe\Core\Extension::class]
We list the core classes, but in fact only it's subclasses are supported
Tags
Methods
classNameIsAllowed()
Check if a DataObject or DataExtension subclass is allowed by checking if the file is in the $allowed_modules array The permission is checked by matching the filePath and modulePath
public
classNameIsAllowed( $className) : bool
Parameters
Tags
Return values
boolclassNameIsSupported()
Check if a (subclass of ) class is a supported
public
classNameIsSupported( $className) : bool
Parameters
Return values
boolenabledModules()
public
enabledModules() : array<string|int, mixed>
Return values
array<string|int, mixed>environmentIsAllowed()
public
environmentIsAllowed() : bool
Return values
boolgetSupportedParentClasses()
public
getSupportedParentClasses() : array<string|int, mixed>
Return values
array<string|int, mixed>isEnabled()
public
isEnabled() : bool
Return values
boolmoduleIsAllowed()
Check if a module is in the $allowed_modules array Required for the buildTask.
public
moduleIsAllowed(string $moduleName) : bool
Parameters
- $moduleName : string