/** * @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; }
/** * @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(); }