logo

Sensible Access Control in CakePHP without using ACL!

logo

Ok, so you are preparing your application to start coding, you are probably going to work on the users and the authentication system first of all and you want to limit different users to different parts of the site.

Sounds simple enough – cakePHP provides something called ACL as part of its core. However you find that when you try and implement it – you realise it is clunky, unreleting and basically far too complicated for every day use.

We used a different approach that we unashamedly rinsed from Studio Canaria, Peter Butler has knocked up a fantastic and a lot more logical approach to ACL. Basically you assign permissions based on groups rather than “objects” and “requesters”.

e.g. to grant access for a group to a specific controller / action you can add a row to the permissions table along the lines of controller:action or controller:* or even just * to override (for say a system developer).

Anyway, I digress. Check it out – his blog is a fantastic resource and has helped me out many times in the past:

http://www.studiocanaria.com/articles/cakephp_auth_component_users_groups_permissions_revisited

Share with your friends and help out this site:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogosphere News
  • E-mail this story to a friend!
  • Identi.ca
  • LinkedIn
  • Live
  • MisterWong
  • MySpace
  • Ping.fm
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz
logo
logo
Powered by Nu Order Webs