authorization icon indicating copy to clipboard operation
authorization copied to clipboard

Problem with policies

Open mmdgreat opened this issue 5 years ago • 1 comments

I have users and usersEmployments controllers and entities. I have created UserPolicy.php and UsersEmploymentsPolicy.php, now the problem is I am trying to access /users-employments/edit/4 it supposed to go to UsersEmploymentsPolicy.php and look for canEdit action but it is going to UserPolicy.php canEdit method. I am not able to understand why it is happening. I have followed blog tutorial from the cookbook and using ORMResolver. My goal is to have a separate policy for each controller/Entity. Please help me.

mmdgreat avatar Jan 26 '21 20:01 mmdgreat

What entity are you putting into the the AuthorizationComponent authorize() method? The ORM resolver uses the class name of the entity to generate the name of the policy to use.

markstory avatar Jan 26 '21 20:01 markstory

Closing due to lack of response.

ADmad avatar Dec 22 '22 04:12 ADmad