0
$\begingroup$

I'm very bad at maths and I've a situation where I need to find number of combinations for a real world situation.

I've 50 files and set of permissions can be given to users on those files such as View, Create, Edit, Delete and Distribute.

Now a user who has Create permission on a file, he should have View permission as well and this permission hierarchy is given below:

  • Delete - Highest level
  • Edit
  • Create
  • View - Lowest level in permission hierarchy

Which means if user has permission to delete a file then he should have all the other 3 permissions.

Also for Distribute permission he should have View permission and distribute forms a different hierarchy.

Now each user can be assigned with different set of permissions on each file, for ex: User1 can have View, Distribute permission on File1 and all permissions on File2 and so on with other 48 files with different permission set.

Now with this combination if I see all the permissions on all 50 files as a single set for a user with satisfying the permission hierarchy condition, how many combinations of permissions can be assigned to a single user? How can I find this value

2 Answers 2

2

If I understand your question correctly, there are nine possible permissions a user can have for a given file:

  1. Delete (and all permissions below it)
  2. Delete (and all permissions below it) + Distribute
  3. Edit (and all permissions below it)
  4. Edit (and all permissions below it) + Distribute
  5. Create (and all permissions below it)
  6. Create (and all permissions below it) + Distribute
  7. View
  8. View + Distribute
  9. Nothing

Since there are 9 choices for each of your 50 files, there are $9^{50}$ possible sets of permissions. This arises from the fact that you have 9 possibilities per file and 50 files, so you multiply all 50 of the 9's together.

0

You need to calculate the number of possible permissions per user per file. If I have read your guidance correctly, this is $9$ (Nothing, View, Create, Edit, Delete, with the last four possibly combined with Distribute).

You then need to combine this with the number of files to get $9^{50}$ possibilities per user. This is about $5 \times 10^{47}$.