Пример #1
0
 /**
  * @param TokenInterface $token
  * @param PatchPropertyActionEventData $data
  * @return int
  */
 protected function patchProperty(TokenInterface $token, PatchPropertyActionEventData $data)
 {
     return $data->getResource()->getCreatedBy() === $token->getUser();
 }
Пример #2
0
 /**
  * @param TokenInterface $token
  * @param PatchPropertyActionEventData $data
  * @return int
  */
 protected function patchProperty(TokenInterface $token, PatchPropertyActionEventData $data)
 {
     return $this->grantOrDeny($data->getResource() === $token->getUser() || $this->hasRole('ROLE_ADMIN', $token));
 }