Skip to content

Commit

Permalink
bypass phase dependency checks if the caller is an admin/m2m
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKranitsas committed Nov 9, 2020
1 parent 1340d68 commit b4eb1e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/ResourceService.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ async function init (currentUser, challengeId, resource, isCreated) {
if (_.get(challenge, 'task.isTask', false)) {
return { resources, memberId, handle }
}
// bypass phase dependency checks if the caller is an m2m/admin
if (currentUser.isMachine || helper.hasAdminRole(currentUser)) {
return { resources, memberId, handle }
}
// check phases dependencies
const dependencies = await ResourceRolePhaseDependencyService.getDependencies({ resourceRoleId: resource.roleId })
_.forEach(dependencies, (dependency) => {
Expand Down

0 comments on commit b4eb1e4

Please sign in to comment.