Exemplo n.º 1
0
 /**
  * @param string $attribute
  * @param ArchivableEntityInterface $archivable
  * @param UserInterface|null $user
  * @return bool
  */
 protected function isGranted($attribute, $archivable, $user = null)
 {
     if (self::MODIFY === $attribute) {
         return !$archivable->isArchived();
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * @param string $attribute
  * @param ArchivableEntityInterface $archivable
  * @param TokenInterface $token
  * @return bool
  */
 protected function voteOnAttribute($attribute, $archivable, TokenInterface $token)
 {
     if (self::MODIFY === $attribute) {
         return !$archivable->isArchived();
     }
     return false;
 }