コード例 #1
0
        public void OnGet(long id)
        {
            Command = _roleApplication.GetDetails(id);
            var permissions = new List <PermissionDto>();

            foreach (var exposition in _exposition)
            {
                var exposedPermissions = exposition.Expose();
                foreach (var(key, value) in exposedPermissions)
                {
                    permissions.AddRange(value);
                    var group = new SelectListGroup
                    {
                        Name = key
                    };
                    foreach (var permission in value)
                    {
                        var item = new SelectListItem(permission.Name, permission.Code.ToString())
                        {
                            Group = group
                        };

                        if (Command.MappedPermissions.Any(x => x.Code == permission.Code))
                        {
                            item.Selected = true;
                        }
                        Permissions.Add(item);
                    }
                }
            }
        }
コード例 #2
0
        public void OnGet(long id)
        {
            Role        = _roleApplication.GetDetails(id);
            Permissions = new List <SelectListItem>();

            foreach (var exposer in _permissionExposer)
            {
                var exposedPermission = exposer.Expose();
                foreach (var(key, value) in exposedPermission)
                {
                    var group = new SelectListGroup()
                    {
                        Name = key
                    };
                    foreach (var permission in value)
                    {
                        var item = new SelectListItem(permission.Name, permission.Code.ToString())
                        {
                            Group = group
                        };

                        if (Role.MappedPermissions.Any(x => x.Code == permission.Code))
                        {
                            item.Selected = true;
                        }

                        Permissions.Add(item);
                    }
                }
            }
        }
コード例 #3
0
 public void OnGet(long id)
 {
     Command = _roleApplication.GetDetails(id);
 }
コード例 #4
0
        public IActionResult OnGetEdit(long id)
        {
            var account = _roleApplication.GetDetails(id);

            return(Partial("Edit", account));
        }
コード例 #5
0
        public IActionResult OnGetEdit(long id)
        {
            var role = _roleApplication.GetDetails(id);

            return(Partial("./Edit", role));
        }