diff options
author | 2019-04-11 06:39:25 +0000 | |
---|---|---|
committer | 2019-04-11 06:39:25 +0000 | |
commit | dbcc039303c7f010348814694b8f75d621aa51e3 (patch) | |
tree | 2ecc14d87b24166c2e6d49f33103b63e1ca4c6fd /3rd_party/static/testapi-ui/app.js | |
parent | d32ce7d109fb36277681629c8e648777664862b2 (diff) | |
parent | 71bdc6752f47b7da7282f786570fbe717973fb6d (diff) |
Merge "Enhanced OVP Web Portal"
Diffstat (limited to '3rd_party/static/testapi-ui/app.js')
-rw-r--r-- | 3rd_party/static/testapi-ui/app.js | 24 |
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; |