The native Auth has got this functionnality. If you use the Auth in mode "actions", you would create
- Aro for each user - Aco for controller/actions pairs in this way : an Aco for the controller name with no parent, and an Aco per action of the controller having the Aco controller as parent. You use the controllers/action as alias. You will allow or deny users for each aco, and Auth will take care of this in beforeFilter. When you want to change the authorization for a User, you just have to use ACL allow/deny (using the console or maybe a view for this). The authotization becomes driven by the DB and not in the code. There is a tutorial there, that uses a role level with user but easy to simplify with only user: http://www.cakephpforum.net/index.php?showtopic=27 On Jul 4, 2:12 am, Tony Thomas <[EMAIL PROTECTED]> wrote: > On Jul 3, 6:23 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > I do not understand the "on the fly" there .. > > Meaning I don't want to have to statically define who can do what. > Instead of something like: > > if ($this->Auth->user('username') == 'User1') { > > // allow them to do stuff > > } else { > > // kick them out > > } > > I want to get user information after they've gone through the login > process in Auth, look at the Acl and determine whether or not they > have permission to do what they want to do. In other words, I don't > want static rules in the controller. I want to load up some variables > from the session and check it against Acl. > > >You are wanted to check > > a permission on an action regarding a user, but is this User "logged- > > in" ? I mean a member of a User model or something similar ?? > > In this case I'm certain the user (me) is logged in. Auth is working > as expected. I just can't get my head around checking Acl. > > For now I've abandoned the built in Acl in lieu of a simple system > using "roles" in the user table. The Acl component is more flexible, > so I'd still like to use it if anyone has advice. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
