ACL

2 views
Skip to first unread message

Tony Nelson

unread,
Nov 8, 2011, 9:41:26 AM11/8/11
to ColdMVC
I've created a sample application that uses the new ACL functionality
included in ColdMVC version 2.0.

https://github.com/tonynelson19/ColdMVC-Samples/tree/master/BookStore-Security

I'm still working on creating official documentation for, but I
figured if people wanted to see it in action, the sooner the better.

Basically you define your roles, resources, and rules inside /config/
acl.cfm.

https://github.com/tonynelson19/ColdMVC-Samples/blob/master/BookStore-Security/config/acl.cfm

Then you can use the assertAllowed() and isAllowed() helpers inside
your controllers and views to check if the current user is allowed
access to perform an action on a resource. You can see this being done
in the following files:

https://github.com/tonynelson19/ColdMVC-Samples/blob/master/BookStore-Security/app/controllers/BookController.cfc
https://github.com/tonynelson19/ColdMVC-Samples/blob/master/BookStore-Security/app/views/book/list.cfm

If the user tries to perform an action that they're not allowed access
to perform, a typed exception is thrown, which can then be handled by
an error controller.

Again, I'll try to get some documentation created for this sometime
soon, but in the meantime if you have any questions, please ask.
Reply all
Reply to author
Forward
0 new messages