views:

56

answers:

2

hello friends, 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 check 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 annoying

1) 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 :)

+1  A: 

Hello RSK,

1. If you put a $this->Auth->allow('action1','action2'...) into your beforeFilter() 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 the build_acl() script in the tutorial at the end of the cake-manual is useful.

2. Allowing to pass the parameter for all users and checking their role in the action is not an option?

Kind regards, Benjamin.

benjamin
thankz for your response , but if i gave this `$this->Auth->allow('action1','action2'...)` the actions will be available for visitors also. i need to make sure that the the user is logged in :)
RSK
Ok. May I suggest that the line "to give permission to all types of user" is changed to "... to all authenticated users".Kind regards.
benjamin
A: 

the solution for the 2nd problem is here
but this is not implemented using ACL :(

RSK
RSK,as this uses non-ACL components, too, a removal of 'I am expecting the answers on the basis of ACL only.' is indicated. Kind regards
benjamin
@benjamin done :D
RSK

related questions