Skip to content

Commit

Permalink
Review comment changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sumathi-thirumani committed Oct 22, 2024
1 parent 3a059be commit 9ae5854
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
5 changes: 1 addition & 4 deletions backend/src/components/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ const roles = {
PenRequestBatch: config.get('server:penRequestBatch:roleAdmin'),
//Help functions created in auth module: isValidStaffAdministrationAdmin
StaffAdministration: config.get('server:administration:roleAdmin'),
NominalRoll: config.get('server:nominalRoll:roleAdmin'),
//Help functions created in auth module: isValidEASAdmin
EAS: config.get('server:eas:roleAdmin')

NominalRoll: config.get('server:nominalRoll:roleAdmin')
}
};

Expand Down
4 changes: 1 addition & 3 deletions backend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ nconf.defaults({
},
eas:{
rootURL: process.env.EAS_API_URL,
assessmentSessionsURL: process.env.EAS_API_URL+ '/sessions',
roleAdmin: process.env.EAS_ADMIN,

assessmentSessionsURL: process.env.EAS_API_URL+ '/sessions'
}
});
module.exports = nconf;
4 changes: 2 additions & 2 deletions frontend/src/components/util/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default {
},
computed: {
...mapState(appStore, ['config']),
...mapState(authStore, ['userInfo','isAuthorizedUser', 'ADVANCED_SEARCH_ROLE', 'VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE', 'EDIT_MACROS_ROLE', 'VIEW_GMP_REQUESTS_ROLE', 'VIEW_UMP_REQUESTS_ROLE', 'PROCESS_STUDENT_ROLE', 'VIEW_PEN_COORDINATOR_INFO_ROLE', 'NOMINAL_ROLL_ROLE', 'STAFF_ADMINISTRATION_ADMIN', 'HAS_STATS_ROLE', 'STUDENT_ANALYTICS_STUDENT_PROFILE', 'STUDENT_ANALYTICS_BATCH','EAS_ADMIN']),
...mapState(authStore, ['userInfo','isAuthorizedUser', 'ADVANCED_SEARCH_ROLE', 'VIEW_EDIT_PEN_REQUEST_BATCH_FILES_ROLE', 'EDIT_MACROS_ROLE', 'VIEW_GMP_REQUESTS_ROLE', 'VIEW_UMP_REQUESTS_ROLE', 'PROCESS_STUDENT_ROLE', 'VIEW_PEN_COORDINATOR_INFO_ROLE', 'NOMINAL_ROLL_ROLE', 'STAFF_ADMINISTRATION_ADMIN', 'HAS_STATS_ROLE', 'STUDENT_ANALYTICS_STUDENT_PROFILE', 'STUDENT_ANALYTICS_BATCH']),
items() {
return [
{
Expand Down Expand Up @@ -327,7 +327,7 @@ export default {
},
{
title: PAGE_TITLES.ASSESSMENTS,
authorized: !this.config.DISABLE_EAS_FUNCTIONALITY && this.EAS_ADMIN,
authorized: !this.config.DISABLE_EAS_FUNCTIONALITY && this.hasRequiredPermission(this.userInfo, PERMISSION.MANAGE_EAS_SESSIONS_PERMISSION),
items: [
{
title: 'Sessions',
Expand Down
19 changes: 2 additions & 17 deletions frontend/src/store/modules/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export const authStore = defineStore('auth', {
isValidNominalRollUser: localStorage.getItem('isValidNominalRollUser') !== null,
isValidGUMPAnalyticsUser: localStorage.getItem('isValidGUMPAnalyticsUser') !== null,
isValidPenRequestBatchAnalyticsUser: localStorage.getItem('isValidPenRequestBatchAnalyticsUser') !== null,
isAuthorizedWebsocketUser: localStorage.getItem('isAuthorizedWebsocketUser') !== null,
isValidEASAdmin: localStorage.getItem('isValidEASAdmin') !== null

isAuthorizedWebsocketUser: localStorage.getItem('isAuthorizedWebsocketUser') !== null
}),
getters: {
acronymsGet: state => state.acronyms,
Expand Down Expand Up @@ -56,9 +54,7 @@ export const authStore = defineStore('auth', {
STAFF_ADMINISTRATION_ADMIN: state => state.isValidNominalRollAdmin || state.isValidStaffAdministrationAdmin, //gives access to admin section of navigation menu
STUDENT_ANALYTICS_STUDENT_PROFILE: state => state.isValidGUMPAnalyticsUser,
STUDENT_ANALYTICS_BATCH: state => state.isValidPenRequestBatchAnalyticsUser,
HAS_STATS_ROLE: state => state.isValidGUMPAnalyticsUser || state.isValidPenRequestBatchAnalyticsUser,
EAS_ADMIN: state => state.isValidEASAdmin, //gives access to admin section of navigation menu

HAS_STATS_ROLE: state => state.isValidGUMPAnalyticsUser || state.isValidPenRequestBatchAnalyticsUser
},
actions: {
//sets Json web token and determines whether user is authenticated
Expand Down Expand Up @@ -224,15 +220,6 @@ export const authStore = defineStore('auth', {
localStorage.removeItem(('isAuthorizedWebsocketUser'));
}
},
async setEASAdmin(isValidEASAdmin) {
if (isValidEASAdmin) {
this.isValidEASAdmin = true;
localStorage.setItem('isValidEASAdmin', 'true');
} else {
this.isValidEASAdmin = false;
localStorage.removeItem(('isValidEASAdmin'));
}
},
async setUserInfo(userInf) {
if (userInf) {
this.userInfo = userInf;
Expand Down Expand Up @@ -296,8 +283,6 @@ export const authStore = defineStore('auth', {
await this.setGUMPAnalytics(response.isValidGUMPAnalyticsUser);
await this.setPenRequestBatchAnalytics(response.isValidPenRequestBatchAnalyticsUser);
await this.setAuthorizedWebsocketUser(response.isAuthorizedWebsocketUser);
await this.setEASAdmin(response.isValidEASAdmin);

ApiService.setAuthHeader(response.jwtFrontend);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/config/update-configmap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PEN_NAMESPACE=$3
COMMON_NAMESPACE=$4
EDX_NAMESPACE=$5
EAS_NAMESPACE=$6
SPLUNK_TOKEN=$7
APP_NAME_UPPER=${APP_NAME^^}

TZVALUE="America/Vancouver"
Expand All @@ -19,7 +20,6 @@ NATS_CLUSTER=educ_nats_cluster
NATS_URL="nats://nats.${COMMON_NAMESPACE}-${envValue}.svc.cluster.local:4222"
SOAM_KC_LOAD_USER_ADMIN=$(oc -n $COMMON_NAMESPACE-$envValue -o json get secret sso-admin-${envValue} | sed -n 's/.*"username": "\(.*\)"/\1/p' | base64 --decode)
SOAM_KC_LOAD_USER_PASS=$(oc -n $COMMON_NAMESPACE-$envValue -o json get secret sso-admin-${envValue} | sed -n 's/.*"password": "\(.*\)",/\1/p' | base64 --decode)
SPLUNK_TOKEN=$(oc -n $PEN_NAMESPACE-$envValue -o json get configmaps ${APP_NAME}-${envValue}-setup-config | sed -n "s/.*\"SPLUNK_TOKEN_${APP_NAME_UPPER}\": \"\(.*\)\"/\1/p")
SERVER_FRONTEND="student-admin-$PEN_NAMESPACE-$envValue.apps.silver.devops.gov.bc.ca"

echo Fetching SOAM token
Expand Down

0 comments on commit 9ae5854

Please sign in to comment.