Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
23 | 28 | public function isAllowed(string $resource, User $user): bool |
|
24 | { |
||
25 | 28 | $collection = $this->permissionRepository->matching( |
|
26 | 28 | Criteria::create() |
|
27 | 28 | ->where(Criteria::expr()->eq('user', $user)) |
|
28 | 28 | ->andWhere(Criteria::expr()->eq('resource', $resource)) |
|
29 | ); |
||
30 | |||
31 | 28 | return !$collection->isEmpty(); |
|
32 | } |
||
33 | } |
||
34 |