Exemplo n.º 1
0
 /**
  * @param TokenInterface $token
  * @param PatchActionEventData $data
  * @return int
  */
 protected function patch(TokenInterface $token, PatchActionEventData $data)
 {
     return $data->getResource()->getCreatedBy() === $token->getUser();
 }
Exemplo n.º 2
0
 /**
  * @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));
 }