aboutsummaryrefslogtreecommitdiffstats
path: root/3rd_party/static/testapi-ui/app.js
diff options
context:
space:
mode:
Diffstat (limited to '3rd_party/static/testapi-ui/app.js')
-rw-r--r--3rd_party/static/testapi-ui/app.js24
1 files changed, 19 insertions, 5 deletions
diff --git a/3rd_party/static/testapi-ui/app.js b/3rd_party/static/testapi-ui/app.js
index edf7663..55603aa 100644
--- a/3rd_party/static/testapi-ui/app.js
+++ b/3rd_party/static/testapi-ui/app.js
@@ -55,11 +55,11 @@
templateUrl: 'testapi-ui/components/guidelines/guidelines.html',
controller: 'GuidelinesController as ctrl'
}).
- // state('communityResults', {
- // url: '/community_results',
- // templateUrl: 'testapi-ui/components/results/results.html',
- // controller: 'ResultsController as ctrl'
- // }).
+ state('communityResults', {
+ url: '/community_results',
+ templateUrl: 'testapi-ui/components/results/results.html',
+ controller: 'ResultsController as ctrl'
+ }).
state('userResults', {
url: '/user_results',
templateUrl: 'testapi-ui/components/results/results.html',
@@ -173,12 +173,26 @@
$rootScope.auth.doSignIn = doSignIn;
$rootScope.auth.doSignOut = doSignOut;
$rootScope.auth.doSignCheck = doSignCheck;
+ $rootScope.auth.canReview = canReview;
var sign_in_url = testapiApiUrl + '/auth/signin';
var sign_out_url = testapiApiUrl + '/auth/signout';
var profile_url = testapiApiUrl + '/profile';
+ function canReview(user) {
+ if (typeof user.role == undefined) {
+ return false;
+ } else if (user.role.indexOf('administrator') != -1) {
+ return true;
+ } else if (user.role.indexOf('reviewer') != -1) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+
/** This function initiates a sign in. */
function doSignIn(type) {
$rootScope.auth.type = type;