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 | /** @var int */ |
||
37 | private $type; |
||
38 | /** @var int */ |
||
39 | private $flags; |
||
40 | /** @var int */ |
||
41 | private $mask; |
||
42 | |||
43 | public function __construct(int $type, int $flags, int $mask) { |
||
48 | |||
49 | /** |
||
50 | * Check if the acl allows a specific permissions |
||
51 | * |
||
52 | * Note that this does not take inherited acls into account |
||
53 | * |
||
54 | * @param int $mask one of the ACL::MASK_* constants |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function allows(int $mask): bool { |
||
60 | |||
61 | /** |
||
62 | * Check if the acl allows a specific permissions |
||
63 | * |
||
64 | * Note that this does not take inherited acls into account |
||
65 | * |
||
66 | * @param int $mask one of the ACL::MASK_* constants |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function denies(int $mask): bool { |
||
72 | |||
73 | public function getType(): int { |
||
76 | |||
77 | public function getFlags(): int { |
||
80 | |||
81 | public function getMask(): int { |
||
84 | } |
||
85 |