Search the Community
Showing results for tags 'design pattern'.
-
hey guys i'm currently creating role and permission for my users which looks like this: users ------------------------ user_id role_id ------------------------ user_permissions ------------------------ user_permission_id name ------------------------ user_roles ------------------------ user_role_id name ------------------------ user_role_permissions ------------------------ user_role_permission_id role_id permission_id ------------------------ a role can be created and permissions are added to that role, giviing user access to certian pages. the problem i face is that my website has 4 types of users admin (me) general public clients clients employees (client employees) all 4 will see different content. here is my problem and what i want to achieve is for my clients to be able to add users (employees) which are linked to thier account as well as giving them certian permission for instance if i had Walmart as a client, they'd have a client role...now if they wanted to add a user (employees) linked to thier account what is the best way to do this? i could have 3 extra tables clients ------------ client_id user_id name ------------ client_users ------------ client_user_id client_id user_id ------------ client_user_premissions ------------ client_user_permissions user_id permission_id ------------ i link a client to a user account....and link a client user to a client and user also the client can pass over certian permission via the client_user_permission any ideas on design pattern would be appreciated as i've never done nothing like this when it comes to users creating users thank you