Example #1
0
        public RolePermissionViewModel GetPermission(string roleId, bool isAll = false)
        {
            var permission = new RolePermissionViewModel();

            permission.GetValue(roleId, isAll);

            return(permission);
        }
Example #2
0
        public RoleManagerViewModel()
        {
            this.Roles = new List <SelectListItem>();

            //get the list of existing roles
            foreach (var role in this.UnitWork.AppRole.Get().Where(r => r.Region == AppContext.AppRegion).OrderBy(r => r.Name))
            {
                this.Roles.Add(new SelectListItem()
                {
                    Text = role.Name, Value = role.Id
                });
            }

            if (this.Roles.Count() > 0)
            {
                this.Roles.First().Selected = true;
                this.SelectedRoleId         = this.Roles.First().Value;
            }

            this.Permission = new RolePermissionViewModel();
        }
Example #3
0
 public override void GetValue(object data)
 {
     this.Permission = GetPermission(data.ToString());
 }