I have a list of 365 customers. Each of them has a potentially unique list of products that they are allowed to order, up to 18 out of 24 products (currently). I would like to use groups to assign permissions. How to determine the minimum number of unique permission sets?
I have a hunch that the answer includes relational division, but I'm still very fuzzy how this works.
To clarify : I am not interested only in users who have the same permissions. I want to find groups that I can use, each user who is potentially a member of several groups can play permissions. For example, group "A" may have a resolution of 99498; group "B" has permission to 99507, 99508, 99512. All three users in the truncated data below will be members of "A", and only the first two will be members of "B".
CREATE TABLE UsersProducts ( [User] INTEGER NOT NULL, [Product] INTEGER NOT NULL, PRIMARY KEY ([User],[Product]) ) CREATE TABLE GroupsProducts ( [Group] INTEGER NOT NULL, [Product] INTEGER NOT NULL, PRIMARY KEY ([Group],[Product]) ) CREATE TABLE GroupsUsers ( [Group] INTEGER NOT NULL, [User] INTEGER NOT NULL, PRIMARY KEY ([Group],[User]) )
source share