Reputation: 560
I'm new to CakePHP but familiar with other PHP frameworks. I'm trying to figure out the 'Cake way' of implementing the following ACL setup..
I currently have ACL configured as the Simple Acl tutorial. This works great when I want to restrict a group to a specific action.
However, if I've one action, e.g. edit, and I want the edit action restricted depending on what group the user is that you're are trying to edit.
A user in the Group 'user' will be denyed access to the edit action.
A user in the Group 'moderator' will be allowed to edit if the user they are editing is in the group 'user'.
A user in the Group 'admin' will be allowed to edit if the user they are editing is in the Group 'user' or 'moderator'.
I'm having trouble getting my head around the fact that my User and Group tables are different to the aco's & aro's and how I should set up this relationship so it doesn't trip me up in the future.
I started experimenting with creating a routing index function that bounced you to different end actions; edit_user, edit_mod, edit_admin which I could then lock down with ACL but I wasn't sure if there was a better way to organised this.
Many thanks in advance,
Pete
Upvotes: 0
Views: 467
Reputation: 96
you could build you permission like this :
ARO:
ACO :
Then you can say :
Upvotes: 1