I'm just taking a stab in the dark here but is the following
possible?  Hopefully someone can help me out..

Create three tables:

create table users(
id,
firstname,
lastname,
username,
email );

create table groups(
id,
name,
description,
parent_id);

create table groups_users(
id,
users_id,
groups_id,
default ); --default is a boolean

Now if we have the user "user1" with an id of 1 and groups "group1"
and "group2", is there anyway you can have alias' such as
"group1_user1" and "group2_user1"?  These alias' would have an ID of 1
the same as "user1".

$aro->create( 1, null, 'user1' );
$aro->create( 0, null, 'group1' );
$aro->create( 0, null, 'group2' );

$aro->setParent('group1', 'group1_user1');
$aro->setParent('group2', 'group2_user1');


I'm just learning this but can you not look up the permissions based
on the alias or the id.  Some extra logic is needed in the
users_controller.php (or somewhere else?) to handle this.  The extra
logic would need to look up the default group's permission first and
then the remaining group permissions if the default group is denied.

Now as I'm reviewing this post I'm wondering how the $aro-
>setParent('group1', 'group1_user1'); knows that "group1_user1" is
actually user1?  Do I have to do something like this:

$aro->create( 1, null, 'user1' );
$aro->create( 1, null, 'group1_user1' );
$aro->create( 1, null, 'group2_user1' );

This looks clunky.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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