Switched to accepting ids (numbers/number arrays) feature/90-accept_objects #101

Merged
niggl merged 26 commits from feature/90-accept_objects into dev 2021-01-15 17:57:47 +00:00
Showing only changes of commit 98d6a1cc64 - Show all commits

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);