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