This can help you :

http://www.cakephpforum.net/index.php?showtopic=27

On Jun 27, 8:22 pm, Josoroma <[EMAIL PROTECTED]> wrote:
> This is my situation, i need to create 6 types or groups of users:
> # -- Administrators
> # ---- Managers
> # ------ Moderators
> # -------- Publishers
> # ---------- Contributors
> # ------------ Guests
>
> Where Administrators inherit all manager permissions, managers inherit
> all moderators permissions, moderators will inherit all publishers
> permissions ...
>
> For the moment i have to controllers:
> -- Users (to manage users)
> -- Categories (to manage listing categories using the tree behavior)
>
> For example, the controller Categories, has more than the 4 default
> actions:
> # -- create
> # -- read
> # -- update
> # -- delete
> Categories also incorporates or needs more actions like:
> # -- index
> # -- view
> # -- add
> # -- edit
> # -- delete
> # -- related
> # -- review
> # -- recountcategories
> # -- recountlistings
>
> Accordingly to my reading and research 
> about:http://manual.cakephp.org/view/171/access-control-lists#access-contro...
>
> First, i want to know if the concept (my situation and concept) is
> good or not:
>
> /* ------------------------------------------------------------ */
> #
> # AROS - $link_id, $parent_id, $alias
> #
> $aro = new Aro();
> #
> # Create the User types
> #
> $aro->create(10, null, 'Administrators');
> $aro->create(20, null, 'Managers');
> $aro->create(30, null, 'Moderators');
> $aro->create(40, null, 'Publishers');
> $aro->create(50, null, 'Contributors');
> $aro->create(60, null, 'Guests');
> #
> # Groups to organize our User Types
> #
> # -- Administrators
> # ---- Managers
> # ------ Moderators
> # -------- Publishers
> # ---------- Contributors
> # ------------ Guests
> #
> $aro->setParent('Administrators', 'Managers');
> $aro->setParent('Managers', 'Moderators');
> $aro->setParent('Moderators', 'Publishers');
> $aro->setParent('Publishers', 'Contributors');
> $aro->setParent('Contributors', 'Guests');
> #
> # Create the "Super Administrator" user, with username --> "admin"
> # AROS - $user_id, $parent_id, $alias
> #
> $aro = new Aro();
> #
> $aro->create( 70, 10, 'admin');
> #
> #
> #
> #
> $aco = new Aco();
> #
> $aco->create(1, null, 'Users');
> $aco->create(2, 1, 'Index');
> $aco->create(3, 1, 'View');
> $aco->create(4, 1, 'Add');
> $aco->create(5, 1, 'Edit');
> $aco->create(6, 1, 'Delete');
> $aco->create(7, null, 'Categories');
> $aco->create(8, 7, 'Index');
> $aco->create(9, 7, 'View');
> $aco->create(10, 7, 'Add');
> $aco->create(11, 7, 'Edit');
> $aco->create(12, 7, 'Delete');
> $aco->create(13, 7, 'Related'); /* To assign related categories */
> $aco->create(14, 7, 'Review'); /* To add a review or comment to any
> category */
> $aco->create(15, 7, 'RecountCategories'); /* To recount each category
> and his/her children categories */
> $aco->create(15, 7, 'RecountListings'); /* To recount each children
> listing who belongs to a any category */
> #
> # -- Users
> # ---- Index
> # ---- View
> # ---- Add
> # ---- Edit
> # ---- Delete
> # -- Categories
> # ---- Index
> # ---- View
> # ---- Add
> # ---- Edit
> # ---- Delete
> # ---- Related
> # ---- Review
> # ---- RecountCategories
> # ---- RecountListings
> /* ------------------------------------------------------------ */
>
> Second, i want to know if: when I use $aro->setParent... this means
> that the Aro inherits all the permission of his-her child group?
>
> Thanks in advance. Any help or tips are welcome.
>
> Maybe if all of us, together, can solve this common problem or
> situation, would be a good example for the rest of the group who has
> problems with ACL.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to