Updating the role management UI to link up the role name to the edit page and implement & remove some removes

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-05 16:09:04 -07:00
parent b0676991ac
commit 7c23b3075f
4 changed files with 36 additions and 8 deletions

View File

@@ -148,6 +148,11 @@ namespace Orchard.Roles.Controllers {
[HttpPost, ActionName("Edit")]
[FormValueRequired("submit.Delete")]
public ActionResult EditDeletePOST(int id) {
return Delete(id, null);
}
[HttpPost]
public ActionResult Delete(int id, string returnUrl) {
if (!Services.Authorizer.Authorize(Permissions.ManageRoles, T("Not authorized to manage roles")))
return new HttpUnauthorizedResult();
@@ -155,6 +160,10 @@ namespace Orchard.Roles.Controllers {
_roleService.DeleteRole(id);
Services.Notifier.Information(T("Role was successfully deleted."));
if (!string.IsNullOrWhiteSpace(returnUrl))
return Redirect(returnUrl);
return RedirectToAction("Index");
} catch (Exception exception) {
Services.Notifier.Error(T("Editing Role failed: {0}", exception.Message));