Esempio n. 1
0
        public IEnumerable <SelectOption> GetBasicRole()
        {
            var sql           = @"
select sys_roleid as Value, name as Name  from sys_role
where is_basic = 1 
";
            var dataList      = Broker.Query <SelectOption>(sql);
            var currentRoleId = Broker.Retrieve <user_info>(UserIdentityUtil.GetCurrentUserId())?.roleid;

            if (string.IsNullOrEmpty(currentRoleId))
            {
                return(new List <SelectOption>());
            }

            return(dataList.Where(item => UserIdentityUtil.IsOwner(currentRoleId, item.Value)));
        }