/** * @param TokenInterface $token * @param PatchActionEventData $data * @return int */ protected function patch(TokenInterface $token, PatchActionEventData $data) { return $data->getResource()->getCreatedBy() === $token->getUser(); }
/** * @param TokenInterface $token * @param PatchActionEventData $data * @return int */ protected function patch(TokenInterface $token, PatchActionEventData $data) { return $this->grantOrDeny($data->getResource() === $token->getUser() || $this->hasRole('ROLE_ADMIN', $token)); }