Beispiel #1
0
        private static bool AnyPermissions(this RegionRoleEntity regionRole, Func <RegionPermission, bool> pred) =>
        new RegionPermission[]
        {
            regionRole.Permissions, regionRole.ChildPermissions, regionRole.ParentPermissions
        }

        .Any(pred);
Beispiel #2
0
 public static bool IsWriter(this RegionRoleEntity regionRole) =>
 regionRole.AnyPermissions(p => (p & RegionPermission.Writer) != 0);
Beispiel #3
0
 public static bool HasPermission(this RegionRoleEntity regionRole, RegionPermission permission) =>
 regionRole.AnyPermissions(p => p.HasFlag(permission));