mirror of https://github.com/apache/cloudstack.git
Disable users from creating public templates based on global setting (#693)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
160bb9e2de
commit
de031faf99
|
|
@ -104,7 +104,13 @@ export default {
|
|||
icon: 'share-alt',
|
||||
label: 'label.action.template.share',
|
||||
dataView: true,
|
||||
args: ['ispublic', 'isfeatured', 'isextractable'],
|
||||
args: (record, store) => {
|
||||
const fields = ['isfeatured', 'isextractable']
|
||||
if (['Admin'].includes(store.userInfo.roletype) || store.features.userpublictemplateenabled) {
|
||||
fields.unshift('ispublic')
|
||||
}
|
||||
return fields
|
||||
},
|
||||
show: (record, store) => {
|
||||
return (['Admin'].includes(store.userInfo.roletype) || // If admin or owner or belongs to current project
|
||||
(record.domainid === store.userInfo.domainid && record.account === store.userInfo.account) ||
|
||||
|
|
@ -225,7 +231,13 @@ export default {
|
|||
icon: 'share-alt',
|
||||
label: 'label.action.iso.share',
|
||||
dataView: true,
|
||||
args: ['ispublic', 'isfeatured', 'isextractable'],
|
||||
args: (record, store) => {
|
||||
const fields = ['isfeatured', 'isextractable']
|
||||
if (['Admin'].includes(store.userInfo.roletype) || store.features.userpublictemplateenabled) {
|
||||
fields.unshift('ispublic')
|
||||
}
|
||||
return fields
|
||||
},
|
||||
show: (record, store) => {
|
||||
return (['Admin'].includes(store.userInfo.roletype) || // If admin or owner or belongs to current project
|
||||
(record.domainid === store.userInfo.domainid && record.account === store.userInfo.account) ||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,9 @@
|
|||
}]" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item :label="$t('label.ispublic')">
|
||||
<a-form-item
|
||||
:label="$t('label.ispublic')"
|
||||
v-if="$store.getters.userInfo.roletype === 'Admin' || $store.getters.features.userpublictemplateenabled" >
|
||||
<a-switch
|
||||
v-decorator="['ispublic', {
|
||||
initialValue: false
|
||||
|
|
|
|||
|
|
@ -339,8 +339,8 @@
|
|||
</a-checkbox>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-checkbox value="ispublic">
|
||||
{{ $t('label.ispublic') }}
|
||||
<a-checkbox value="requireshvm">
|
||||
{{ $t('label.requireshvm') }}
|
||||
</a-checkbox>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
@ -351,8 +351,10 @@
|
|||
</a-checkbox>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-checkbox value="requireshvm">
|
||||
{{ $t('label.requireshvm') }}
|
||||
<a-checkbox
|
||||
value="ispublic"
|
||||
v-if="$store.getters.userInfo.roletype === 'Admin' || $store.getters.features.userpublictemplateenabled" >
|
||||
{{ $t('label.ispublic') }}
|
||||
</a-checkbox>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
|
|||
Loading…
Reference in New Issue