mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user