示例#1
0
        public bool AddPermission(string Permission, string content = "")
        {
            QcPermissionEnum pe = QcPermissionEnum.GetPermissionFromName(Permission);

            if (pe != null)
            {
                QcPermission p = new QcPermission();
                p.RoleCode        = this.RoleCode;
                p.PermisssionCode = pe.PermisssionCode;
                p.Content         = content;
                bool ret = p.Update();
                if (ret)
                {
                    return(ret);
                }
            }
            return(false);
        }
示例#2
0
        public bool RemovePermission(string PermissionName)
        {
            QcPermissionEnum pe = QcPermissionEnum.GetPermissionFromName(PermissionName);

            if (pe != null)
            {
                string sql = "delete  QC_USE_PERMISSION where 角色编码='" + this.RoleCode
                             + "' and 权限编码='" + pe.Code + "'";
                if (DbHelper.Execute(sql))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(false);
        }