Skip to content

Conversation

mike1796
Copy link
Member

@mike1796 mike1796 commented Aug 3, 2017

Migration and separation should be ok
Voter too
Still need to complete the EventSubscriber

Migration and separation should be ok
Voter too
Still need to complete the EventSubscriber
use Symfony\Component\Validator\Constraints as Assert;

/**
* User's account.
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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!');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Attribute not supported'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants