Exemple #1
0
        public async Task <ActionResult> EditRole(int roleId)
        {
            if (!this.HttpContext.Session.HasSystemActionRights() || !this.HttpContext.Session.HasSystemActionRight(ActionRights.SecurityManagement))
            {
                return(RedirectToAction("Index", "Home"));
            }

            var data = new AddEditRoleData {
                RoleEdited = await SecurityGuiHelper.GetRoleAsync(roleId)
            };

            if (data.RoleEdited == null)
            {
                return(RedirectToRoute("ManageRoles"));
            }

            await FillAddEditRoleDataAsync(data);

            data.SystemRightsSet = SecurityGuiHelper.GetAllSystemActionRightIDsForRole(roleId);
            data.AuditActionsSet = SecurityGuiHelper.GetAllAuditActionIDsForRole(roleId);
            return(View("~/Views/Admin/EditRole.cshtml", data));
        }