Skip to content

Commit 84cba65

Browse files
Pearl1594yadvr
authored andcommitted
image: Hide status column for users other than Root admin (apache#480)
Fixes apache#476 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent fc5bb9f commit 84cba65

4 files changed

Lines changed: 13 additions & 1 deletion

File tree

ui/src/config/section/image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333
resourceType: 'Template',
3434
filters: ['self', 'shared', 'featured', 'community'],
3535
columns: () => {
36-
var fields = ['name', 'ostypename', 'status', 'hypervisor', 'account', 'domain']
36+
var fields = ['name', 'ostypename', 'hypervisor', 'account', 'domain']
3737
if (['Admin'].includes(store.getters.userInfo.roletype)) {
3838
fields.push('order')
3939
}

ui/src/views/AutogenView.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,11 @@ export default {
582582
if (!this.items || this.items.length === 0) {
583583
this.items = []
584584
}
585+
585586
if (['listTemplates', 'listIsos'].includes(this.apiName) && this.items.length > 1) {
586587
this.items = [...new Map(this.items.map(x => [x.id, x])).values()]
587588
}
589+
588590
for (let idx = 0; idx < this.items.length; idx++) {
589591
this.items[idx].key = idx
590592
for (const key in customRender) {

ui/src/views/image/IsoZones.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ export default {
175175
scopedSlots: { customRender: 'action' }
176176
}
177177
]
178+
const userInfo = this.$store.getters.userInfo
179+
if (!['Admin'].includes(userInfo.roletype) &&
180+
(userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) {
181+
this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' })
182+
}
178183
},
179184
mounted () {
180185
this.fetchData()

ui/src/views/image/TemplateZones.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ export default {
185185
scopedSlots: { customRender: 'action' }
186186
}
187187
]
188+
const userInfo = this.$store.getters.userInfo
189+
if (!['Admin'].includes(userInfo.roletype) &&
190+
(userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) {
191+
this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' })
192+
}
188193
},
189194
mounted () {
190195
this.fetchData()

0 commit comments

Comments
 (0)