I have this scenario where user has its role
NormalUser
Custodian
Finance
both Custodian and Finance is a Super
You can add the Flag-attribute to the Enum
[Flags]
public enum Role
{
NormalUser,
Custodian,
Finance,
SuperUser = Custodian | Finance,
All = Custodian | Finance | NormalUser
}
Then you can check for a role with this expression:
Role testRole = Role.Finance
if(testRole & Role.SuperUser == Role.SuperUser){
//testRole is SuperUser
}