-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Voters are incoming #20
base: master
Are you sure you want to change the base?
Conversation
Migration and separation should be ok Voter too Still need to complete the EventSubscriber
src/AppBundle/Entity/Profile.php
Outdated
use Symfony\Component\Validator\Constraints as Assert; | ||
|
||
/** | ||
* User's account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
profile
$profile = $event->getControllerResult(); | ||
$method = $event->getRequest()->getMethod(); | ||
|
||
if (!$profile instanceof Profile || Request::METHOD_POST !== $method) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is access only checked for POST
requests ?
{ | ||
$user = $token->getUser(); | ||
|
||
if (!$user instanceof Profile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename profile to UserProfile
to get things easier to understand.
return $this->canAccess($profile, $user); | ||
} | ||
|
||
throw new \LogicException('This code should not be reached!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Attribute not supported'
Migration and separation should be ok
Voter too
Still need to complete the EventSubscriber