parent
09ad081b37
commit
98d6a1cc64
@ -90,7 +90,7 @@ export class PermissionController {
|
|||||||
if (oldPermission.id != permission.id) {
|
if (oldPermission.id != permission.id) {
|
||||||
throw new PermissionIdsNotMatchingError();
|
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) {
|
if (existingPermission) {
|
||||||
await this.remove(permission.id, true);
|
await this.remove(permission.id, true);
|
||||||
return new ResponsePermission(existingPermission);
|
return new ResponsePermission(existingPermission);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user