tags:

views:

101

answers:

1

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

A: 

you should utilize cakephp ACL. But the general idea is you have users and they all belong to a group. so in user table you would have a group_id column. After the user is logged in. you check his/her permission based on his group_id using acl componnent.

Funky Dude
Thanks, I'll look into that. I am very new to cake and am trying to port a web application I wrote over to cake. This does sound like what I need though.