| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class PrivilegeChecker implements PrivilegeCheckerInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Returns `true` if the user is an admin user |
||
| 17 | */ |
||
| 18 | 1 | public function isAdmin(UserInterface $user): bool |
|
| 19 | { |
||
| 20 | 1 | return in_array( |
|
| 21 | 1 | AclEnum::USER_EDIT->value, |
|
| 22 | 1 | $this->getAcl($user), |
|
| 23 | true, |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Returns user's acl |
||
| 29 | * |
||
| 30 | * @return array<int> |
||
| 31 | */ |
||
| 32 | 1 | public function getAcl( |
|
| 37 | ]; |
||
| 38 | } |
||
| 40 |