We’re rewarding the question askers & reputations are being recalculated! Read more.
3 added 499 characters in body
source | link

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 1 and 2 together.

I dont think my current design can handle checking if a Role is only available if the user belongs to 2 groups vs 1. Is there some SQL I can do or some way to construct the tables?

Ex:

Group Table: Group1:RoleID1 Group2:RoleID2 Group3:RoleID3 HOW TO REPRESENT GROUP1+2 MAP TO RoleID3?

Role Table:

RoleID1:Group1 RoleID2:Group2 RoleID3: Group3 RoleID3:NEED GROUPS 1 AND 2 TOGETHER

For my example above, i can have a Group that maps directly to a Role OR 2 Groups maps to the same Role. So Role3 can be available for a User with Group3 OR Groups1+2. I am not sure how to differentiate the 2. Will i need to redesign the datatables or have update to my SQL?

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 1 and 2 together.

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

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 1 and 2 together.

I dont think my current design can handle checking if a Role is only available if the user belongs to 2 groups vs 1. Is there some SQL I can do or some way to construct the tables?

Ex:

Group Table: Group1:RoleID1 Group2:RoleID2 Group3:RoleID3 HOW TO REPRESENT GROUP1+2 MAP TO RoleID3?

Role Table:

RoleID1:Group1 RoleID2:Group2 RoleID3: Group3 RoleID3:NEED GROUPS 1 AND 2 TOGETHER

For my example above, i can have a Group that maps directly to a Role OR 2 Groups maps to the same Role. So Role3 can be available for a User with Group3 OR Groups1+2. I am not sure how to differentiate the 2. Will i need to redesign the datatables or have update to my SQL?

2 "Thanks" removed.
source | link

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 RoleIDRoleID and GroupNameGroupName and a Role table with RoleIDRoleID and RoleNameRoleName. I am able to satisfy 1 and 2 fine but I am stuck on 3. Say currently iI have Group 1 mapped to Roles 1&2. Group 2 mapped to Roles 2. Now lets say iI have Role 3 which is ONLY available if iI have Group 1and1 and 2 together.

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

Thanks!

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?

Thanks!

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 1 and 2 together.

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

1
source | link

Design a way for multiple and single group mapped to a Role?

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?

Thanks!