Bundle/BusinessEntityBundle/Security/Voter/BusinessEntityOwnerVoter.php 1 location
|
@@ 40-47 (lines=8) @@
|
| 37 |
|
/** |
| 38 |
|
* {@inheritdoc} |
| 39 |
|
*/ |
| 40 |
|
protected function voteOnAttribute($attribute, $subject, TokenInterface $token) |
| 41 |
|
{ |
| 42 |
|
return $token->getUser() instanceof $this->userClass |
| 43 |
|
&& ($token->getUser()->hasRole('ROLE_VICTOIRE') |
| 44 |
|
|| $token->getUser()->hasRole('ROLE_VICTOIRE_DEVELOPER') |
| 45 |
|
|| $subject->getAuthor() === $token->getUser() |
| 46 |
|
); |
| 47 |
|
} |
| 48 |
|
} |
| 49 |
|
|
Bundle/PageBundle/Security/Voter/PageOwnerVoter.php 1 location
|
@@ 37-45 (lines=9) @@
|
| 34 |
|
/** |
| 35 |
|
* {@inheritdoc} |
| 36 |
|
*/ |
| 37 |
|
protected function voteOnAttribute($attribute, $subject, TokenInterface $token) |
| 38 |
|
{ |
| 39 |
|
return $token->getUser() instanceof $this->userClass |
| 40 |
|
&& ( |
| 41 |
|
$token->getUser()->hasRole('ROLE_VICTOIRE') |
| 42 |
|
|| $token->getUser()->hasRole('ROLE_VICTOIRE_DEVELOPER') |
| 43 |
|
|| $subject->getAuthor() === $token->getUser() |
| 44 |
|
); |
| 45 |
|
} |
| 46 |
|
} |
| 47 |
|
|