Some one else just asked the same question about doing acl without
having to add users to the aros table. I am not sure what the
resistance there is. I Just think of it as another association where
every user has one access request object.
Here is how I use the auth component in 1.2.
In app/app_controller.php I include the auth component with:
var $components = array('Auth');
I have a login action in my users controller as well as a beforeFilter
that allows access to the action. See that code as well as a sample
login.ctp here: http://bin.cakephp.org/view/1314967094
I used cake/console/cake acl to add my intital aro's and aco's when
first getting started:
// A users group
cake/console/cake acl create aro / users
// The user id of my user is 1. I add that user as a child of the
users aro
cake/console/cake acl create aro users User.1
With the aco's you could add a controller at the root and then various
actions as children of that controller. To keep it simple we can just
add some common actions at the root level.
cake/console/cake acl create aco / index
cake/console/cake acl create aco / view
In 1.2.0.5146 'cake acl grant' would not work for me so I inserted my
aros_acos mappings manually. I have not yet tested with 1.2.0.5333.
Now I point my browser to my site and I am presented with a login
page. After I login I can view users/index for instance.
The first message in the following thread is a working example of
setting up some of the above dynamically:
http://groups.google.com/group/cake-php/browse_thread/thread/479cd6f421ed29f7
** Note **
When logging in, the password is passed to the password function in
the auth component (cake/libs/controllers/components/auth.php). This
method uses CAKE_SESSION_STRING from app/config/core.php to salt the
password. The encryption is done with the hash function in the
security class (cake/libs/security.php) and it defaults to sha1. Be
sure you are storing passwords in the same format or change the
password method to suit your needs.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---