mirror of https://github.com/apache/cloudstack.git
image: Hide status column for users other than Root admin (#480)
Fixes #476 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
fc5bb9f123
commit
84cba65c0e
|
|
@ -33,7 +33,7 @@ export default {
|
|||
resourceType: 'Template',
|
||||
filters: ['self', 'shared', 'featured', 'community'],
|
||||
columns: () => {
|
||||
var fields = ['name', 'ostypename', 'status', 'hypervisor', 'account', 'domain']
|
||||
var fields = ['name', 'ostypename', 'hypervisor', 'account', 'domain']
|
||||
if (['Admin'].includes(store.getters.userInfo.roletype)) {
|
||||
fields.push('order')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -582,9 +582,11 @@ export default {
|
|||
if (!this.items || this.items.length === 0) {
|
||||
this.items = []
|
||||
}
|
||||
|
||||
if (['listTemplates', 'listIsos'].includes(this.apiName) && this.items.length > 1) {
|
||||
this.items = [...new Map(this.items.map(x => [x.id, x])).values()]
|
||||
}
|
||||
|
||||
for (let idx = 0; idx < this.items.length; idx++) {
|
||||
this.items[idx].key = idx
|
||||
for (const key in customRender) {
|
||||
|
|
|
|||
|
|
@ -175,6 +175,11 @@ export default {
|
|||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
]
|
||||
const userInfo = this.$store.getters.userInfo
|
||||
if (!['Admin'].includes(userInfo.roletype) &&
|
||||
(userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) {
|
||||
this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' })
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.fetchData()
|
||||
|
|
|
|||
|
|
@ -185,6 +185,11 @@ export default {
|
|||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
]
|
||||
const userInfo = this.$store.getters.userInfo
|
||||
if (!['Admin'].includes(userInfo.roletype) &&
|
||||
(userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) {
|
||||
this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' })
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.fetchData()
|
||||
|
|
|
|||
Loading…
Reference in New Issue