login with users, groups and permissions

Posted by Dan Bemowski on Stack Overflow See other posts from Stack Overflow or by Dan Bemowski
Published on 2009-09-27T07:26:00Z Indexed on 2010/06/12 19:02 UTC
Read the original article Hit count: 127

Filed under:

OK, I have a set of tables that I want to use for my user logins. I am guessing that I need a separate model for each table in the database. My tables are as follows:

Users - user information such as first and last name, groups_id, status, etc...

groups - defines the user groups with id, name, description

permissions - defines a list of permissions that a group can have

permission_assignments - groups_id and permissions_id. many to many relationship table

I am not sure how to go about populating an array that would contain the list of permissions that a user would have based on the group they are in after a successful login. Basically, a user belongs to a group, and the group gets assigned permissions. I want to then be able to validate functions/methods based on weather the logged in user has certain permissions.

Any help is appreciated

© Stack Overflow or respective owner

Related posts about cakephp