Skip to content

Commit

Permalink
fix(assets): migrate tenant only if user is admin
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mauran committed Sep 28, 2023
1 parent 4e4eed9 commit c24f942
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/modules/asset/AssetService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ export class AssetService {
return lock(`engine:${engineId}:${newEngineId}`, async () => {
const recovery = new RecoveryQueue();

if (user.profileIds.includes("admin")) {
throw new BadRequestError(
`User ${user._id} is not authorized to migrate assets`
);
}

try {
// check if tenant destination of the the same group
const engine = await this.getEngine(engineId);
Expand Down

0 comments on commit c24f942

Please sign in to comment.