/** * @inheritdoc */ public function execute(User $user, Resource $resource = null) { return $user->id() == 1; }
/** * @param User $user * * @throws SecurityAccessDenied */ private function userHasNoAccess(User $user) { throw new SecurityAccessDenied("User of id {$user->id()} have no access to this resource."); }