/// <summary>
 /// 不允许被外部调用
 /// </summary>
 public AtawApplicationConfig()
 {
     // string myConn = ConfigurationManager.AppSettings["sqlConnectionString"].ToString();
     //string basePath =
     // Databases = new RegNameList<DatabaseConfigItem>();
     AppSettings = new RegNameList <KeyValueItem>();
 }
示例#2
0
        public static RightFilterType RightVerification(string expressString, RegNameList <FunRightItem> FunResultItems)
        {
            List <string>       menus    = new List <string>();
            List <FunRightItem> menuFuns = new List <FunRightItem>();

            FormartString(expressString, menuFuns, menus);
            if (menus == null || menus.Count == 0)
            {
                return(RightFilterType.Success);
            }                                                                         //只验证登陆
            var builder = AtawAppContext.Current.AtawRightBuilder.Value;

            //firstNoMatch 第一个不匹配,isMath 是否都不匹配 0都不匹配,1至少有一个匹配
            for (int i = 0, firstNoMatch = 0, isMatch = 0; i < menus.Count; i++)
            {
                string menu   = menus[i];
                var    status = builder.MenuRightCheck(menu);

                if (status == 1)
                {
                    var items = builder.CreateFunRight(menu);
                    FunResultItems.AddRange(items);
                    isMatch = 1;
                }
                if (status != 1 && firstNoMatch == 0)
                {
                    firstNoMatch = status;
                }
                if (i == menus.Count - 1 && isMatch == 0)
                {
                    if (firstNoMatch == -1)
                    {
                        return(RightFilterType.UnRenew);
                    }
                    else if (firstNoMatch == -2)
                    {
                        return(RightFilterType.DenyPermission);
                    }
                }
            }

            //判断功能权限
            for (int i = 0; i < menuFuns.Count; i++)
            {
                var item = FunResultItems[menuFuns[i].RegName.ToUpper()];
                if (item != null && item.IsAllow)
                {
                    return(RightFilterType.Success);
                }
                if (i == menuFuns.Count - 1)
                {
                    return(RightFilterType.DenyPermission);
                }
            }
            return(RightFilterType.Success);
        }
示例#3
0
 public AtawConfigInfo()
 {
     //  Databases = new RegNameList<DatabaseConfigItem>();
     ControlUnits = new RegNameList <ControlUnitItemInfo>();
     BaseConfigs  = new RegNameList <BaseConfigItemInfo>();
 }
示例#4
0
 public ThemeListConfig()
 {
     ThemeLists = new RegNameList <ThemeListConfigItem>();
 }
示例#5
0
 public MvcConfigInfo()
 {
     DataRoutes = new RegNameList <RoutesInfo>();
 }
示例#6
0
 public DbCodeTableXml()
 {
     DbCodeTables = new RegNameList <DbCodeTable>();
 }
示例#7
0
 private AtawIocContext()
 {
     MainContainer   = new UnityContainer();
     PlugInModelList = new RegNameList <PlugInModel>();
 }
示例#8
0
 public DataDictXml()
 {
     DataDicts = new RegNameList <DataDict>();
 }
示例#9
0
 public DBConfig()
 {
     Databases = new RegNameList <DatabaseConfigItem>();
 }
示例#10
0
 public DataDict()
 {
     DDItems = new RegNameList <KeyValueItem>();
 }