Fix deletion of permissions after modification

Permissions could not be deleted, when they were modified (eg. change
of role or of verbs).
This commit is contained in:
René Pfeuffer
2019-03-01 14:10:39 +01:00
parent 9b6063c4c5
commit b537a2a2ba
7 changed files with 62 additions and 37 deletions

View File

@@ -451,7 +451,10 @@ function deletePermissionFromState(
) {
let newPermission = [];
for (let i = 0; i < oldPermissions.length; i++) {
if (oldPermissions[i] !== permission) {
if (
oldPermissions[i].name !== permission.name ||
oldPermissions[i].groupPermission !== permission.groupPermission
) {
newPermission.push(oldPermissions[i]);
}
}