Thursday, October 27, 2011

Re: Going back to school: ACL

Ha you've hit pretty close to a change I've made in the way Cake works in order to address the prefix in what I think is a better way.  In our app we keep prefix routing but get rid of the method routing.  So we still get the $this->params->params['prefix'] but route the user to the index() method instead of the admin_index() method.   We then leave it up to ACL completely to decide whether your role has access to the index function.   This allows us to get rid of 50% of the view files and 50% of the controller methods. 

We can have different views for different user roles in that we assign view prefixes to user roles.  So we can have an admin view, and all users in the admin user role would see /Posts/View/Posts/admin/index.ctp instead of /Posts/View/Posts/index.ctp if and only if the admin view exists.  We could do the same thing for managers, users, etc, and leave it up to each app to decide whether managers would see the admin view or the manager view or the guest view. 

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: