Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand more on Enum Flags? #3

Open
nsmela opened this issue Aug 4, 2023 · 0 comments
Open

Expand more on Enum Flags? #3

nsmela opened this issue Aug 4, 2023 · 0 comments

Comments

@nsmela
Copy link

nsmela commented Aug 4, 2023

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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant