1 | <?php |
||
12 | class Abac |
||
13 | { |
||
14 | /** @var \PhpAbac\Manager\ConfigurationManager **/ |
||
15 | private $configuration; |
||
16 | /** @var \PhpAbac\Manager\PolicyRuleManager **/ |
||
17 | private $policyRuleManager; |
||
18 | /** @var \PhpAbac\Manager\AttributeManager **/ |
||
19 | private $attributeManager; |
||
20 | /** @var \PhpAbac\Manager\CacheManager **/ |
||
21 | private $cacheManager; |
||
22 | |||
23 | /** |
||
24 | * @param array $configPaths |
||
25 | */ |
||
26 | 1 | public function __construct($configPaths) |
|
33 | |||
34 | /** |
||
35 | * @param array $configPaths |
||
36 | */ |
||
37 | 1 | public function configure($configPaths) { |
|
42 | |||
43 | /** |
||
44 | * Return true if both user and object respects all the rules conditions |
||
45 | * If the objectId is null, policy rules about its attributes will be ignored |
||
46 | * In case of mismatch between attributes and expected values, |
||
47 | * an array with the concerned attributes slugs will be returned. |
||
48 | * |
||
49 | * Available options are : |
||
50 | * * dynamic_attributes: array |
||
51 | * * cache_result: boolean |
||
52 | * * cache_ttl: integer |
||
53 | * * cache_driver: string |
||
54 | * |
||
55 | * Available cache drivers are : |
||
56 | * * memory |
||
57 | * |
||
58 | * @param string $ruleName |
||
59 | * @param object $user |
||
60 | * @param object $object |
||
61 | * @param array $options |
||
62 | * @return boolean|array |
||
63 | */ |
||
64 | 1 | public function enforce($ruleName, $user, $object = null, $options = []) { |
|
102 | } |
||
103 |