Skip to content

Commit

Permalink
Merge pull request #46 from topcoder-platform/feature/admin-app-164
Browse files Browse the repository at this point in the history
bypass phase dependency checks if the caller is an admin/m2m
  • Loading branch information
rootelement committed Nov 11, 2020
2 parents 1340d68 + b4eb1e4 commit bbcc913
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 bbcc913

Please sign in to comment.