Generate ACO records for your controllers and actions with AcoSyncShell
Aug 01 2008
Continuing in my previous vein of ACL related topics. I’ve got another handy addition to the ACL user’s toolbox. In my previous tutorials on auth and acl I posted a little controller action that helped maintain the ACO side of your ACL. I got pretty good feedback on that snippet, and have taken the time to expand it into a shell.
Introducing the aco_sync shell
The aco_sync shell takes everything that was good about buildAcl() and adds a bit of flair. aco_sync retains its ability to non-destructively add nodes to the acos table based on changes made to your application since the last time it ran. This is done simply by running
from your prompt. It also has the ability to remove uneeded controllers and actions from the ACL as well. By running
Show Plain TextThe shell will not only add all missing Actions and Controllers to your ACL table but also remove all no longer existing nodes. Making ACL management a snap. No longer do you have to manually add ACO records when creating new controllers and actions.
To use the shell simply Download the Aco Sync Shell and place it in either app/vendors/shells or cake/vendors/shells/. Open a prompt and cd into your cake/console directory. You should now be able to run the aco_sync shell. One warning though, the shell will not work if you don’t already have the ACL table in your database.
I hope you find this useful. Let me know if you have any troubles with it.
Update: You can find the newest version of this file in my github repository
Search
Categories
Recent Posts
- Using bindModel to get to deep relations
- New home, new sideproject
- Using bitmasks to indicate status
- AclExtras Shell
- Getting a new Oven, Migrating from CakePHP 1.1 to 1.2
- Code Completion for CakePHP in Eclipse
- CakePHP RC3 released and CakePHP 1.1 new release
- Book Review: CakePHP Application Development
- Providing Contextual Form Help with Mootools
- Creating gracefully degrading javascript and enabling progressive enhancement
Comments
Martin Bavio on 1/8/08
Mark, this is AMAZING! I´m gonna add it to my apps right now! Thanks, you are my day-hero.
mark story on 22/8/08
Martin: I’m glad you found it useful. I’ve been using it on a few apps and it saves me a ton of time.
Jan Boonen on 15/9/08
Mark, thanks for this excellent tool. I noticed one change though. In the old buildAcl function private functions were not created in the ACO database, but the shell doesn’t make this difference. Could you fix that?
mark story on 15/9/08
Jan Boonen: I don’t know how I missed that but it has been fixed. Check my github for the new version.
Raph on 10/10/08
Very useful tool. :)
VVil. 12 hours, 41 minutes ago
Thanks for this very useful tool.
But, I have one little question…
For example I have controller ‘Users’.
What are these “appcontroller” and “userscontroller” alias with parent_id to ‘Users’?
It’s not a controller method…(?)
Have Something to say?