Example #1
0
 public ActionResult RoleEdit(RoleViewModel model)
 {
     if(ModelState.IsValid)
     {
      RolesManager.ChangeRole(model.RoleId, model.PermissionBrowse, model.PermissionEdit, model.PermissionDelete);
      return RedirectToAction("Roles");
     }
     else
         return View();
 }
Example #2
0
        public ActionResult RoleEdit(int id)
        {
            RoleViewModel roleViewModel = new RoleViewModel();
            Role role = RolesManager.GetRole(id);
            if (role != null)
            {
                roleViewModel.RoleId = id;
                roleViewModel.PermissionBrowse = role.Permission.PermissionBrowse;
                roleViewModel.PermissionEdit = role.Permission.PermissionEdit;
                roleViewModel.PermissionDelete = role.Permission.PermissionDelete;
                roleViewModel.PermissionPaths = role.Permission.PermissionPaths;

                return View(roleViewModel);
            }
            else
            {
                return RedirectToAction("Index", "Error");
            }
        }
Example #3
0
 public ActionResult Roles(RoleViewModel model)
 {
     return View(RolesManager.GetAllRoles());
 }