Currently I am trying to setup a relationship between user groups and roles.

I am trying to satisfy:

  1. Multiple roles apply to single group
  2. multiple groups can have same role
  3. multiple groups with single role.

I have a Group Table with RoleID and GroupName and a Role table with RoleID and RoleName. I am able to satisfy 1 and 2 fine but I am stuck on 3. Say currently i have Group 1 mapped to Roles 1&2. Group 2 mapped to Roles 2. Now lets say i have Role 3 which is ONLY available if i have Group 1and 2 together.

Is there some SQL i can do or some way to construct the tables?


Related posts

Recent Viewed