Пример #1
0
        public List <Grantee> GranteeSystemPrivileges(string privilege, bool isAdmin)
        {
            List <Grantee> result  = new List <Grantee>();
            DataSet        dataSet = this.systemPrivilegeRepository.Grantee(privilege.ToUpper(), BooleanUtils.FromBoolean(isAdmin));
            DataTable      table   = dataSet.Tables[0];

            for (int i = 0; i < table.Rows.Count; i++)
            {
                Grantee p = new Grantee
                {
                    Name    = table.Rows[i]["GRANTEE"].ToString(),
                    IsAdmin = BooleanUtils.FromString(table.Rows[i]["ADMIN_OPTION"].ToString())
                };
                result.Add(p);
            }
            return(result);
        }
Пример #2
0
        public List <Privilege> SystemPrivileges(string username, bool isAdmin)
        {
            List <Privilege> result  = new List <Privilege>();
            DataSet          dataSet = this.systemPrivilegeRepository.View(username.ToUpper(), BooleanUtils.FromBoolean(isAdmin));
            DataTable        table   = dataSet.Tables[0];

            for (int i = 0; i < table.Rows.Count; i++)
            {
                Privilege privilege = new Privilege
                {
                    Name    = table.Rows[i]["PRIVILEGE"].ToString(),
                    IsAdmin = BooleanUtils.FromString(table.Rows[i]["ADMIN_OPTION"].ToString())
                };
                result.Add(privilege);
            }
            return(result);
        }