I am planning on have an unknown number of permissions. My intial estimate is roughly 20-30. These permissions will cover a variety of things related to whether a user can create/edit/view various items reports/limits/data etc.
The questions is what is the best practice for this scenerio?
My thoughts below feel free to ignore and just make suggestions:
- A Permissions class that controls the whole mess and can be used in
subsequent User Derivative classes. Then checked using something like
User.Permissions.ReportsView
- A single [Flag] type enumeration with all the permissions that can be stored in a hex field in a database
- A system of [Flag] type enumerations; so that a user will be flagged for report permissions and then have those permissions defined using a second enumeration. These will be stored in set of database fields mirroring the same structure.