diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Services/RoleService.cs b/src/Orchard.Web/Modules/Orchard.Roles/Services/RoleService.cs index 3240669e0..b3fafe8a7 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Services/RoleService.cs +++ b/src/Orchard.Web/Modules/Orchard.Roles/Services/RoleService.cs @@ -90,10 +90,6 @@ namespace Orchard.Roles.Services { roleRecord.Name = roleName; roleRecord.RolesPermissions.Clear(); - if (!String.Equals(currentRoleName, roleName)) { - _roleEventHandlers.Renamed(new RoleRenamedContext {Role = roleRecord, NewRoleName = roleName, PreviousRoleName = currentRoleName}); - } - foreach (var rolePermission in rolePermissions) { string permission = rolePermission; if (_permissionRepository.Get(x => x.Name == permission) == null) { @@ -116,6 +112,10 @@ namespace Orchard.Roles.Services { foreach(var permission in currentPermissions.Values) _roleEventHandlers.PermissionRemoved(new PermissionRemovedContext { Role = roleRecord, Permission = permission.Permission }); + if (!String.Equals(currentRoleName, roleName)) { + _roleEventHandlers.Renamed(new RoleRenamedContext {Role = roleRecord, NewRoleName = roleName, PreviousRoleName = currentRoleName}); + } + TriggerSignal(); }