问题
Am I doing it right?
I have a couple of entities
I grant users different ACL permissions on the Organisation, based on these permission I restrict routes by using the following
$authorizationChecker = $this->get('security.authorization_checker');
if(false == $authorizationChecker->isGranted('VIEW',$organisation) ){
throw new AccessDeniedException();
}
Now inside a organisation a user can create forms, but I want to restrict access to the whole form process based on if the user is a member of the organisation.
So I have the following route for the index view of the forms
/form/{id}
and something like this for a new form, etc etc you get the drift
/form/new/{id}
And i'm passing in the Organisation based on the id, i'm then just checking the users permssions based on the ACL for the organisation and using that to determine weather they can see/create the forms
So I'm using a ACL from the Organisation Entity to restrict working with the Form Entity
Is this the correct way to do this? if not, how would I do it?
来源:https://stackoverflow.com/questions/36928720/symfony-acl-permissions