mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
offering: don't show system offering to non-root admins
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
d9092093e3
commit
40355f46b0
@ -41,7 +41,7 @@ export default {
|
||||
name: 'systemoffering',
|
||||
title: 'System Offerings',
|
||||
icon: 'setting',
|
||||
permission: [ 'listInfrastructure' ],
|
||||
permission: [ 'listServiceOfferings', 'listInfrastructure' ],
|
||||
params: { 'issystem': 'true' },
|
||||
columns: [ 'name', 'systemvmtype', 'cpunumber', 'cpuspeed', 'memory', 'storagetype', 'tags' ],
|
||||
details: [ 'name', 'id', 'displaytext', 'systemvmtype', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'tags', 'domain', 'zone', 'created' ]
|
||||
|
||||
@ -2,12 +2,11 @@ import { asyncRouterMap, constantRouterMap } from '@/config/router'
|
||||
|
||||
function hasApi (apis, route) {
|
||||
if (route.meta && route.meta.permission) {
|
||||
for (const api of apis) {
|
||||
if (route.meta.permission.includes(api)) {
|
||||
return true
|
||||
for (const permission of route.meta.permission) {
|
||||
if (!apis.includes(permission)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user