silverstripe /
silverstripe-framework
| 1 | <?php |
||
| 2 | |||
| 3 | namespace SilverStripe\Security; |
||
| 4 | |||
| 5 | use SilverStripe\ORM\DataExtension; |
||
| 6 | use SilverStripe\ORM\ManyManyList; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Provides standard permission fields for inheritable permissions |
||
| 10 | * |
||
| 11 | * @property string $CanViewType |
||
| 12 | * @property string $CanEditType |
||
| 13 | * @method ManyManyList ViewerGroups() |
||
| 14 | * @method ManyManyList EditorGroups() |
||
| 15 | */ |
||
| 16 | class InheritedPermissionsExtension extends DataExtension |
||
| 17 | { |
||
| 18 | private static $db = [ |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 19 | 'CanViewType' => "Enum('Anyone, LoggedInUsers, OnlyTheseUsers, Inherit', 'Inherit')", |
||
| 20 | 'CanEditType' => "Enum('LoggedInUsers, OnlyTheseUsers, Inherit', 'Inherit')", |
||
| 21 | ]; |
||
| 22 | |||
| 23 | private static $many_many = [ |
||
|
0 ignored issues
–
show
|
|||
| 24 | 'ViewerGroups' => Group::class, |
||
| 25 | 'EditorGroups' => Group::class, |
||
| 26 | ]; |
||
| 27 | |||
| 28 | private static $defaults = [ |
||
|
0 ignored issues
–
show
|
|||
| 29 | 'CanViewType' => InheritedPermissions::INHERIT, |
||
| 30 | 'CanEditType' => InheritedPermissions::INHERIT, |
||
| 31 | ]; |
||
| 32 | } |
||
| 33 |