Hi again everyone, I'm still having fun with my website - thought I'd tackle the auth system again, I'm still waiting on news about the next version of othAuth so I thought I'd try my own solution for the time being.
This is how I'm envisioning my system working at the minute (subject to modification if needed): I have 6 tables (these aren't complete schemas, just what I need to figure the high-level stuff out - for example, I'll have passwords and such to be stored in the users table later): users --id (PK) --username usergroups --id (PK) --groupname permissions --id (PK) --permission users_usergroups --user_id (FK) --usergroup_id (FK) users_permissions --user_id (FK) --permission_id (FK) --type (a tinyint field specifying whether to allow or deny this action) usergroups_permissions --usergroup_id (FK) --permission_id (FK) --type (as above) So far (querying the database directly from the console, I haven't written the Cake code yet to link all this together): - I can retrieve which users are in a specific group, or vice versa see which groups a user belongs to. - I can find which permissions a specific usergroup has (haven't done the reverse yet). - I can find which permissions a specific user has (and again, haven't done the reverse so far). What I need though is to be able to retrieve the permissions for each usergroup a specific user belongs to. Ideally I'd be able to get the permissions belonging to that user as an individual at the same time, so I'd have something like: #From users_permissions: blogs_can_create_blog [allow] gallery_can_create_album [allow] #From usergroups_permissions: blogs_can_create_post [allow] blogs_can_edit_own_post [allow] blogs_can_edit_all_posts [deny] blogs_can_delete_own_post [allow] Having the type column in the permissions pretty much rules out HABTM, or does it? I'm prepared to handle the queries manually if I have to, but I'd much rather use Cake's built-in stuff, unless it would make life harder. Is this something I can do without going nuts trying to figure it out? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
