Esempio n. 1
0
 public void RemoveACItem(IACItem acitme)
 {
     lock (mACItemList.SyncRoot)
     {
         mACItemList.Remove(acitme);
     }
 }
Esempio n. 2
0
 public void AppendACItem(IACItem acitme)
 {
     lock (mACItemList.SyncRoot)
     {
         mACItemList.Add(acitme);
     }
 }
Esempio n. 3
0
        public bool Verify(string type, object target, ushort acOpt, bool isQuiet)
        {
            if (SystemContext.MonitorSystem.IsExit || SystemContext.MonitorSystem.IsDebug2)
            {
                return(true);
            }

            if (mCurACL.Count == 0)
            {
                RefreshACL();
            }

            if (mCurACL.Count > 0)
            {
                IACItem acitem = mCurACL[type + "." + target] as IACItem;
                if (acitem != null)
                {
                    if ((acitem.CtrlOpt & acOpt) > 0)
                    {
                        return(true);
                    }
                }
            }
            else if (Name.Equals("admin"))
            {
                return(true);
            }

            if (!isQuiet)
            {
                MessageBox.Show("当前用户 [" + Name + "] 没有“" + GetDesc(type, target.ToString()) + "”的“" + GetACOptDesc(acOpt) + "”权限!", "权限校验失败", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(false);
        }
Esempio n. 4
0
 private bool CheckACItem(IACItem item, ushort opt)
 {
     if (item != null)
     {
         return((item.CtrlOpt & opt) > 0);
     }
     return(false);
 }
Esempio n. 5
0
        public IACItem[] GetFullACL()
        {
            ArrayList aclist = new ArrayList();

            IACItem[] acitems;

            string[] namelist = Roles;
            if (namelist != null)
            {
                IRoleConfig roleConfig;
                foreach (string name in namelist)
                {
                    if (!name.Equals(""))
                    {
                        roleConfig = SystemContext.RoleConfigManager.GetConfig(name);
                        if (roleConfig != null && roleConfig.Enabled)
                        {
                            acitems = roleConfig.GetACL();
                            if (acitems != null)
                            {
                                foreach (IACItem acitem in acitems)
                                {
                                    if (!aclist.Contains(acitem))
                                    {
                                        aclist.Add(acitem);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (Enabled)
            {
                acitems = GetACL();
                if (acitems != null)
                {
                    foreach (IACItem acitem in acitems)
                    {
                        if (!aclist.Contains(acitem))
                        {
                            aclist.Add(acitem);
                        }
                    }
                }
            }

            if (aclist.Count > 0)
            {
                IACItem[] list = new IACItem[aclist.Count];
                aclist.CopyTo(list, 0);
                return(list);
            }
            return(null);
        }
Esempio n. 6
0
 public IACItem[] GetACL()
 {
     lock (mACItemList.SyncRoot)
     {
         if (mACItemList.Count > 0)
         {
             IACItem[] list = new IACItem[mACItemList.Count];
             mACItemList.CopyTo(list, 0);
             return(list);
         }
         return(null);
     }
 }