Beispiel #1
0
 public function voteOnAttribute($attribute, $subject, TokenInterface $token)
 {
     if (TokenUtilities::isInteractiveRequest($token)) {
         foreach ($token->getRoles() as $role) {
             if ($role->getRole() == 'ROLE_ADMIN' || $role->getRole() == 'ROLE_SUPER_ADMIN') {
                 return true;
             }
         }
     }
     return false;
 }
Beispiel #2
0
 public function voteOnAttribute($attribute, $subject, TokenInterface $token)
 {
     return TokenUtilities::isInteractiveRequest($token) && TokenUtilities::hasRole($token, 'ROLE_EDITOR');
     return false;
 }