flexible-aspnetcore-authorization
flexible-aspnetcore-authorization copied to clipboard
Expand more on Enum Flags?
Hey Jason,
Would it be easier to use bit-shifting to declare the permissions? Or make groups of permissions by adding the View and Manage for the Manage permissions? Or would these be a bad practice?
For example:
[Flags]
public enum Permissions
{
None = 0,
ViewCounter = 1<<0, // 1
ViewWeather = 1<<1, // 2
ViewRoles = 1<<2, // 4
ManageRoles = ViewRoles | 1<<3, // 4 + 8 = 12
}