| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function assert(Acl $acl, RoleInterface $role = null, ResourceInterface $resource = null, $privilege = null) |
||
| 27 | { |
||
| 28 | /** @var HasOwner $object */ |
||
| 29 | $object = $resource->getInstance(); |
||
|
1 ignored issue
–
show
|
|||
| 30 | |||
| 31 | if (CurrentUser::get() && CurrentUser::get() === $object->getOwner()) { |
||
| 32 | return true; |
||
| 33 | } |
||
| 34 | |||
| 35 | return $acl->reject('the object does not belong to the user'); |
||
|
1 ignored issue
–
show
|
|||
| 36 | } |
||
| 38 |