mirror of https://github.com/apache/cloudstack.git
iam: control show/hide setting tab for account & domain (#239)
Fixes #237 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
91de18e3d5
commit
5d0825ca8d
|
|
@ -61,7 +61,7 @@
|
|||
v-for="tab in tabs"
|
||||
:tab="$t(tab.name)"
|
||||
:key="tab.name"
|
||||
v-if="checkShowTabDetail(tab.name)">
|
||||
v-if="checkShowTabDetail(tab)">
|
||||
<component
|
||||
:is="tab.component"
|
||||
:resource="resource"
|
||||
|
|
@ -430,17 +430,12 @@ export default {
|
|||
}
|
||||
return json[responseName][objectName]
|
||||
},
|
||||
checkShowTabDetail (tabKey) {
|
||||
// get tab item from the route
|
||||
const itemTab = this.tabs.filter(item => item.name === tabKey)
|
||||
|
||||
// check tab item not exists
|
||||
if (!itemTab || !itemTab[0]) {
|
||||
return false
|
||||
checkShowTabDetail (tab) {
|
||||
if ('show' in tab) {
|
||||
return tab.show(this.resource, this.$route, store.getters.userInfo)
|
||||
}
|
||||
|
||||
// get permission from the route
|
||||
const permission = itemTab[0].permission ? itemTab[0].permission[0] : ''
|
||||
const permission = tab.permission ? tab.permission[0] : ''
|
||||
|
||||
// check permission not exists
|
||||
if (!permission || permission === '') {
|
||||
|
|
|
|||
|
|
@ -105,8 +105,9 @@ export default {
|
|||
component: () => import('@/components/view/ResourceLimitTab.vue')
|
||||
},
|
||||
{
|
||||
name: 'settings',
|
||||
component: () => import('@/components/view/SettingsTab.vue')
|
||||
name: 'Settings',
|
||||
component: () => import('@/components/view/SettingsTab.vue'),
|
||||
show: (record, route, user) => { return ['Admin'].includes(user.roletype) }
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
|
|
@ -246,8 +247,9 @@ export default {
|
|||
component: () => import('@/components/view/ResourceLimitTab.vue')
|
||||
},
|
||||
{
|
||||
name: 'settings',
|
||||
component: () => import('@/components/view/SettingsTab.vue')
|
||||
name: 'Settings',
|
||||
component: () => import('@/components/view/SettingsTab.vue'),
|
||||
show: (record, route, user) => { return ['Admin'].includes(user.roletype) }
|
||||
}
|
||||
],
|
||||
treeView: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue