Merge branch 'refs/heads/1.10.x' into 1.10.2

This commit is contained in:
Sebastien Ros 2017-04-13 12:42:46 -07:00
commit 358c57464e

View File

@ -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();
}