Esempio n. 1
0
 /**
  * @param Authorizable $source
  * @param Authorizable $target
  * @return boolean
  */
 public function execute(Authorizable $source, Authorizable $target, \ArrayAccess $environment, Manager $manager)
 {
     return $source instanceof User && $target instanceof Project && $source->getAuthAttributes()['age'] > 18;
 }
Esempio n. 2
0
 /**
  * @param Authorizable $source
  * @param Authorizable $target
  * @return boolean
  */
 public function execute(Authorizable $source, Authorizable $target, \ArrayAccess $environment, Manager $manager)
 {
     return $source instanceof User && $target instanceof User && $source->getId() === $target->getId();
 }