Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

SUP-1909, Challenge Cards: With Observer role, Submit button should not appear #363

Merged
merged 1 commit into from
Oct 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/services/challenge.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@
challenge.userAction = null;
}
}

// if user has role of observer
var roles = challenge.userDetails.roles;
if (roles.length > 0) {
var submitterRole = _.findIndex(roles, function(role) {
var lRole = role.toLowerCase();
return lRole === 'submitter';
});
if (submitterRole === -1) {
challenge.userAction = null;
}
}
}
});
}
Expand Down