1 | <?php declare(strict_types=1); |
||
24 | class ACL { |
||
25 | const TYPE_ALLOW = 0; |
||
26 | const TYPE_DENY = 1; |
||
27 | |||
28 | const MASK_READ = 0x0001; |
||
29 | const MASK_WRITE = 0x0002; |
||
30 | const MASK_EXECUTE = 0x00020; |
||
31 | const MASK_DELETE = 0x10000; |
||
32 | |||
33 | const FLAG_OBJECT_INHERIT = 0x1; |
||
34 | const FLAG_CONTAINER_INHERIT = 0x2; |
||
35 | |||
36 | private $type; |
||
37 | private $flags; |
||
38 | private $mask; |
||
39 | |||
40 | public function __construct(int $type, int $flags, int $mask) { |
||
45 | |||
46 | /** |
||
47 | * Check if the acl allows a specific permissions |
||
48 | * |
||
49 | * Note that this does not take inherited acls into account |
||
50 | * |
||
51 | * @param int $mask one of the ACL::MASK_* constants |
||
52 | * @return bool |
||
53 | */ |
||
54 | public function allows(int $mask): bool { |
||
57 | |||
58 | /** |
||
59 | * Check if the acl allows a specific permissions |
||
60 | * |
||
61 | * Note that this does not take inherited acls into account |
||
62 | * |
||
63 | * @param int $mask one of the ACL::MASK_* constants |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function denies(int $mask): bool { |
||
69 | |||
70 | public function getType(): int { |
||
73 | |||
74 | public function getFlags(): int { |
||
77 | |||
78 | public function getMask(): int { |
||
81 | } |
||
82 |