Common permission for groups in Acl-cakePHP
I am using Acl in new web app.
in my app there are four groups of users. I have given$this->Auth->authorize = 'actions'
so that it will chec开发者_如何转开发k the permission for actions automatically.
my problem is some of the actions such as change Password,edit profile,etc...
are common to all users. But now i need to create each record for the permission of each users in acos_aros table. this is too annoying1) Is there any way to give permission to all types of users with a single allow statement?
2) Is there any way to allow and deny user by checking whether parameter is passed or not? that means i need to give permission to pass parameter to an action for a specific user. If any other user pass the parameter and try to access the data i need to deny them.whether row level access control can be done with ACL?
Any help will be appreciated.
Thankz in advance :)If you put a
$this->Auth->allow('action1','action2'...)
into yourbeforeFilter()
of the controller, access is granted to all users. If you need an ACL-only solution, you have to create a parent aco to which all other acos you want to allow are children. Then grant your users the rights on the parent. The ACL plugin from the bakery could come in handy, if you already have your ACL tree structure. For building the ACL tree structure thebuild_acl()
script in the tutorial at the end of the cake-manual is useful.Allowing to pass the parameter for all users and checking their role in the action is not an option?
the solution for the 2nd problem is here
but this is not implemented using ACL :(
精彩评论