1 | <?php |
||
18 | class Force |
||
19 | { |
||
20 | /** @var string $resource */ |
||
21 | protected $resource; |
||
22 | |||
23 | /** @var bool $allowed */ |
||
24 | protected $allowed; |
||
25 | |||
26 | /** |
||
27 | * Constructor |
||
28 | * |
||
29 | * @param string $resource What is granted permission to |
||
30 | * @param bool $allowed True or false |
||
31 | */ |
||
32 | public function __construct(string $resource, bool $allowed = true) |
||
37 | |||
38 | /** |
||
39 | * Check if allowed i.e. user matches. |
||
40 | * |
||
41 | * @param string $resource Resource to check |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function check(string $resource): bool |
||
52 | } |
||
53 |