Skip to content

Commit

Permalink
[UPDATED]-Added ipp-admin role to config file
Browse files Browse the repository at this point in the history
  • Loading branch information
ndasanayaka committed Feb 28, 2024
1 parent 6a69062 commit 98575e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@
return this.$keycloak && this.$keycloak.idTokenParsed ? this.$keycloak.idTokenParsed.email : ''
},
is_admin: function() {
return this.$keycloak.hasRealmRole("admin")
let admin = Vue.prototype.$Config.keycloak.admin
console.log(admin)
return this.$keycloak.hasRealmRole(admin)
}
},
methods: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/PsCalculatorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@
return resultArray
},
is_admin: function() {
return this.$keycloak.hasRealmRole("admin")
let admin = Vue.prototype.$Config.keycloak.admin
return this.$keycloak.hasRealmRole(admin)
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/SdcCalculatorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@
return this.$keycloak && this.$keycloak.idTokenParsed ? this.$keycloak.idTokenParsed.email : ''
},
is_admin: function() {
return this.$keycloak.hasRealmRole("admin")
let admin = Vue.prototype.$Config.keycloak.admin
return this.$keycloak.hasRealmRole(admin)
},
spdmodels() {
Expand Down
5 changes: 3 additions & 2 deletions src/components/SettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
return this.$keycloak && this.$keycloak.idTokenParsed ? this.$keycloak.idTokenParsed.preferred_username : ''
},
is_admin: function() {
return this.$keycloak.hasRealmRole("admin")
let admin = Vue.prototype.$Config.keycloak.admin
return this.$keycloak.hasRealmRole(admin)
},
},
methods: {
Expand Down Expand Up @@ -154,7 +155,7 @@
}
// save
if(this.isglobal) {
this.dbrecord.username = "admin"
this.dbrecord.username = Vue.prototype.$Config.keycloak.admin
} else {
this.dbrecord.username = this.username
}
Expand Down

0 comments on commit 98575e3

Please sign in to comment.