public HttpResponseMessage RemoveRole(string id, string roleid) { PermissionsViewModel model = new PermissionsViewModel(); try { if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(roleid)) { model.success = "true"; return(this.Request.CreateResponse <PermissionsViewModel>(HttpStatusCode.OK, model)); } else { int idp = int.Parse(id); int idrole = int.Parse(roleid); if (ApplicationRoleManager.RemovePermission4Role(idrole, idp)) { model.success = "true"; } else { model.success = "false"; model.message = "rimozione non effettuata"; } } } catch (Exception ex) { model.success = "false"; model.message = ex.Message; } return(this.Request.CreateResponse <PermissionsViewModel>(HttpStatusCode.OK, model)); }
public PartialViewResult DeleteRoleFromPermissionReturnPartialView(int id, int permissionId) { ApplicationRoleManager.RemovePermission4Role(id, permissionId); return(PartialView("_ListRolesTable4Permission", ApplicationRoleManager.GetPermission(permissionId))); }
public PartialViewResult DeletePermissionFromRoleReturnPartialView(int id, int permissionId) { ApplicationRoleManager.RemovePermission4Role(id, permissionId); return(PartialView("_ListPermissions", ApplicationRoleManager.GetRole(id))); }