Remarkable

This morning I tried unsuccessfully to get CakePHP's built-in 'Access Control List' feature working. I get the impression that ACL is bleeding edge stuff, and that the current documentaion is not accurate (or it may be that the functionality just doesn't quite work right out of the box.) That's OK. CakePHP is still quite young, and for my current purposes ACL looked like overkill anyway.

So this afternoon I set about implementing my own lightweight user authentication system, incorporating 'Users' and 'Roles' tables in the database, with corresponding CakePHP controllers and associations. Scaffolding provided instant create/edit/list/delete functionality for users and roles, including the ability to assign roles to users and vice versa. Total set-up time: maybe 30 minutes for everything.

The bigger hurdle was implementing an authentication controller for handling the login form, logging in, and logging out. This took a bit longer, but at every turn I discovered that the typical minutiae (Setting a message to be displayed on the following screen, managing session variables, et cetera) had already been taken care of for me in the base Controller class, leaving me to spend most of my time worrying about logic instead of implementation. This is good stuff.

The next step will be to write a controller 'Component' for managing user access to controller functions.

Tagged:

Also

1 comment

 
Daniel Hofstetter wrote 8 years 35 weeks ago

Yeah, the dbAcl stuff is

Yeah, the dbAcl stuff is broken. I hope it will be fixed soon.

Please register or login to post a comment.
Syndicate content

Twitter

  • Speaking of the 1990's http://www.hwg.org/ 4 years 19 weeks ago
  • "Oh, I see! You're like a webmaster from the 1990s, except you can't even code HTML." http://bit.ly/dsjBEX #fb 4 years 19 weeks ago
  • Please, please: DO NOT put a hyperlink on a filename unless clicking on said link actually downloads that file. #ihatesourceforge #uxfail 4 years 19 weeks ago
  • RT @ebertchicago:Josh reminds me: If we went back to what the Founding Fathers wanted, as Sarah Palin desires, she wouldn't be able to vote. 4 years 19 weeks ago
  • RT @tommysalami: Great "how I got into horror" blog post by @brittnahjade http://is.gd/c4dj8 Awwww :) 4 years 19 weeks ago

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key