Ticket #132 (closed enhancement: fixed)
Make UserGroup more OOP-y
| Reported by: | skippy | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | Habari Core Software | Version: | SVN |
| Keywords: | usergroup permissions ACL | Cc: |
Description
The UserGroup class should be modified from using static methods to a more object-oriented implementation by extending the QueryRecord object, as described in this post: http://groups.google.com/group/habari-dev/msg/59d9e06675929e23
Attached is an untested work-in-progress effort to that effect.
UserGroups can be created using a static method. All other interactions are done through member properties:
// create the editors group $editors= new UserGroup( array( 'name' => 'editors') ); // allow editors to publish posts $editors->grant( 'publish posts' ); // editors should be explicitly forbidden from changing the theme $editors->deny( 'change theme'); // add a user to the editors group $editors->add( User::get_by_name('skippy')->id );
