M
Mr Newbie
Nope, I dont mean SQL Roles. I am writing an ASP.NET application using forms
authentication.
I have an enum which contains role enumerations :-
Public Enum Roles
User
Administrator
Accounts
Arbitrator
End Enum
I have an SQL Database which is to contain a field or fields which will have
the users roles stored within, A user may have one or more roles. In one of
the applications layers, I will use a function to do checks on the users
role such as
isUserInRole( User.Identity.Name , Roles.Administrator ) As Boolean
The challenge I face is how best to store the results so that I may cleanly
determine the roles which the user has. I dont like the idea of using
multiple columns because it's messy, but so is storing more than one role
type in a field, I would have do something like have comma seperated value
strings, so my users roles could contain values like 0,1,2. I would then
have to search this string or convert it to an array or something.
Is there a 'Clean' way to do this ?
Ideas anyone ?
authentication.
I have an enum which contains role enumerations :-
Public Enum Roles
User
Administrator
Accounts
Arbitrator
End Enum
I have an SQL Database which is to contain a field or fields which will have
the users roles stored within, A user may have one or more roles. In one of
the applications layers, I will use a function to do checks on the users
role such as
isUserInRole( User.Identity.Name , Roles.Administrator ) As Boolean
The challenge I face is how best to store the results so that I may cleanly
determine the roles which the user has. I dont like the idea of using
multiple columns because it's messy, but so is storing more than one role
type in a field, I would have do something like have comma seperated value
strings, so my users roles could contain values like 0,1,2. I would then
have to search this string or convert it to an array or something.
Is there a 'Clean' way to do this ?
Ideas anyone ?