public RolePermissionViewModel GetPermission(string roleId, bool isAll = false) { var permission = new RolePermissionViewModel(); permission.GetValue(roleId, isAll); return(permission); }
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(); }
public override void GetValue(object data) { this.Permission = GetPermission(data.ToString()); }