示例#1
0
        public static TypeRulePack GetTypeRules(Lite <RoleEntity> roleLite)
        {
            var result = new TypeRulePack {
                Role = roleLite
            };
            Schema s = Schema.Current;

            cache.GetRules(result, TypeLogic.TypeToEntity.Where(t => !t.Key.IsEnumEntity() && s.IsAllowed(t.Key, false) == null).Select(a => a.Value));

            foreach (TypeAllowedRule r in result.Rules)
            {
                Type type = TypeLogic.EntityToType[r.Resource];

                if (OperationAuthLogic.IsStarted)
                {
                    r.Operations = OperationAuthLogic.GetAllowedThumbnail(roleLite, type);
                }

                if (PropertyAuthLogic.IsStarted)
                {
                    r.Properties = PropertyAuthLogic.GetAllowedThumbnail(roleLite, type);
                }

                if (QueryAuthLogic.IsStarted)
                {
                    r.Queries = QueryAuthLogic.GetAllowedThumbnail(roleLite, type);
                }
            }

            return(result);
        }
示例#2
0
 public static void StartAllModules(SchemaBuilder sb)
 {
     TypeAuthLogic.Start(sb);
     PropertyAuthLogic.Start(sb);
     QueryAuthLogic.Start(sb);
     OperationAuthLogic.Start(sb);
     PermissionAuthLogic.Start(sb);
 }
示例#3
0
 public static void StartAllModules(SchemaBuilder sb, DynamicQueryManager dqm)
 {
     TypeAuthLogic.Start(sb, dqm);
     PropertyAuthLogic.Start(sb);
     QueryAuthLogic.Start(sb, dqm);
     OperationAuthLogic.Start(sb);
     PermissionAuthLogic.Start(sb, dqm);
 }
示例#4
0
        public static void StartAllModules(SchemaBuilder sb, bool activeDirectoryIntegration = false)
        {
            TypeAuthLogic.Start(sb);
            PropertyAuthLogic.Start(sb);
            QueryAuthLogic.Start(sb);
            OperationAuthLogic.Start(sb);
            PermissionAuthLogic.Start(sb);

            if (activeDirectoryIntegration)
            {
                PermissionAuthLogic.RegisterTypes(typeof(ActiveDirectoryPermission));
            }
        }