public Func <PropertyRoute, PropertyAllowed> MergeDefault(Lite <RoleEntity> role)
        {
            return(pr =>
            {
                if (!BasicPermission.AutomaticUpgradeOfProperties.IsAuthorized(role) || PropertyAuthLogic.AvoidAutomaticUpgradeCollection.Contains(pr))
                {
                    return AuthLogic.GetDefaultAllowed(role) ? PropertyAllowed.Modify : PropertyAllowed.None;
                }

                return GetDefault(pr, role);
            });
        }
        public Func <OperationSymbol, OperationAllowed> MergeDefault(Lite <RoleEntity> role)
        {
            return(key =>
            {
                if (!BasicPermission.AutomaticUpgradeOfOperations.IsAuthorized(role) || OperationAuthLogic.AvoidAutomaticUpgradeCollection.Contains(key))
                {
                    return AuthLogic.GetDefaultAllowed(role) ? OperationAllowed.Allow : OperationAllowed.None;
                }

                return GetDefault(key, role);
            });
        }
Beispiel #3
0
        public Func <PropertyRoute, PropertyAllowed> MergeDefault(Lite <RoleEntity> role)
        {
            return(pr =>
            {
                if (!BasicPermission.AutomaticUpgradeOfProperties.IsAuthorized(role))
                {
                    return AuthLogic.GetDefaultAllowed(role) ? PropertyAllowed.Write : PropertyAllowed.None;
                }

                var maxUp = PropertyAuthLogic.MaxAutomaticUpgrade.TryGetS(pr);

                var def = GetDefault(pr, role);

                return maxUp.HasValue && maxUp <= def ? maxUp.Value : def;
            });
        }
Beispiel #4
0
        public Func <object, QueryAllowed> MergeDefault(Lite <RoleEntity> role)
        {
            return(key =>
            {
                if (!BasicPermission.AutomaticUpgradeOfQueries.IsAuthorized(role))
                {
                    return AuthLogic.GetDefaultAllowed(role) ? QueryAllowed.Allow: QueryAllowed.None;
                }

                var maxUp = QueryAuthLogic.MaxAutomaticUpgrade.TryGetS(key);

                var def = GetDefault(key, role);

                return maxUp.HasValue && maxUp <= def ? maxUp.Value : def;
            });
        }
 public Func <PermissionSymbol, bool> MergeDefault(Lite <RoleEntity> role)
 {
     return(new ConstantFunction <PermissionSymbol, bool>(AuthLogic.GetDefaultAllowed(role)).GetValue);
 }