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

Commit 9095333

Browse files
author
vikasrohit
committed
SUP-1909, Challenge Cards: With Observer role, Submit button should not appear
-- set user action to null for a challenge where user don't have 'submitter role'
1 parent ff6bd80 commit 9095333

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/services/challenge.service.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@
8585
challenge.userAction = null;
8686
}
8787
}
88+
89+
// if user has role of observer
90+
var roles = challenge.userDetails.roles;
91+
if (roles.length > 0) {
92+
var submitterRole = _.findIndex(roles, function(role) {
93+
var lRole = role.toLowerCase();
94+
return lRole === 'submitter';
95+
});
96+
if (submitterRole === -1) {
97+
challenge.userAction = null;
98+
}
99+
}
88100
}
89101
});
90102
}

0 commit comments

Comments
 (0)