Bitwise operations are important when dealing with permissions. In this case the permissions are designed as flags and the operations described will include the scenario where one variable can have one or multiple permissions, all described in the enum. The following enum defines a set of permissions for a particular operation.
1 2 3 4 5 6 7 |
[Flags] public enum Flags : long { T1_CanDelete = 2 << 0, T1_CanEdit = 2 << 1, T2_CanDelete = 2 << 2 } |
Or Operation ToRead more