Fixed old reference

ref #90
This commit is contained in:
Nicolai Ort 2021-01-15 18:39:04 +01:00
parent 09ad081b37
commit 98d6a1cc64
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ export class PermissionController {
if (oldPermission.id != permission.id) {
throw new PermissionIdsNotMatchingError();
}
let existingPermission = await this.permissionRepository.findOne({ target: permission.target, action: permission.action, principal: permission.principal }, { relations: ['principal'] });
let existingPermission = await this.permissionRepository.findOne({ target: permission.target, action: permission.action, principal: await permission.getPrincipal() }, { relations: ['principal'] });
if (existingPermission) {
await this.remove(permission.id, true);
return new ResponsePermission(existingPermission);