Hello there,
I have plans for the following entities;
- User (UserId, etc)
- UserRoles (RoleId, UserId)
- RolePrivilege(RolePrivelegeId,UserRoleId,HasInvoiceFormAccess, HasOtherAccessEtc)
- UserPrivilege(UserPrivegeId,UserId,HasInvoiceFormAccess, HasOtherAccessEtc)
So I have two questions?
I was wondering what people normally consider the best way to store enumerations? Say for example I want certain users to have only access to the Invoicing Form. I want to be able to go;
if (CurrentLoggedInUser.HasInvoiceFormAccess) {openinvoiceform();}
Is it a bad idea to have the UserPrivilege Table store all these as fields? (It seems like an OK thing to do but I wonder about updatability even though it is hard coded application logic)
and
How is the best way to structure these tables?
I'm confused about this Would I be foolish to make RolePrivelege Entity a subtype of UserPrivilege? The role and user privileges entities will be exactly the same except that there will be 1:m user to roles and 1:1 User to UserPrivilege.....or is the best way just to have one privilege table and create some kind of intermediate joining table?
Thank you so much for reading my post and I would be very happy to hear any thoughts
Thank you