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

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