This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new f5c7729871a Fix to allow actions on the network if it belongs to a
project (#9550)
f5c7729871a is described below
commit f5c7729871adb8015334e662095aed2658ed1510
Author: Harikrishna <[email protected]>
AuthorDate: Wed Aug 21 12:07:31 2024 +0530
Fix to allow actions on the network if it belongs to a project (#9550)
---
ui/src/config/section/network.js | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js
index 8399d9769ef..a4a598103e3 100644
--- a/ui/src/config/section/network.js
+++ b/ui/src/config/section/network.js
@@ -140,7 +140,9 @@ export default {
icon: 'edit-outlined',
label: 'label.update.network',
dataView: true,
- disabled: (record, user) => { return (record.account !==
user.userInfo.account && !['Admin',
'DomainAdmin'].includes(user.userInfo.roletype)) },
+ disabled: (record, user) => {
+ return !record.projectid && (record.account !==
user.userInfo.account && !['Admin',
'DomainAdmin'].includes(user.userInfo.roletype))
+ },
popup: true,
component: shallowRef(defineAsyncComponent(() =>
import('@/views/network/UpdateNetwork.vue')))
},
@@ -150,7 +152,9 @@ export default {
label: 'label.restart.network',
message: 'message.restart.network',
dataView: true,
- disabled: (record, user) => { return (record.account !==
user.userInfo.account && !['Admin',
'DomainAdmin'].includes(user.userInfo.roletype)) },
+ disabled: (record, user) => {
+ return !record.projectid && (record.account !==
user.userInfo.account && !['Admin',
'DomainAdmin'].includes(user.userInfo.roletype))
+ },
args: (record, store, isGroupAction) => {
var fields = []
if (isGroupAction || record.vpcid == null) {
@@ -189,7 +193,9 @@ export default {
label: 'label.action.delete.network',
message: 'message.action.delete.network',
dataView: true,
- disabled: (record, user) => { return (record.account !==
user.userInfo.account && !['Admin',
'DomainAdmin'].includes(user.userInfo.roletype)) },
+ disabled: (record, user) => {
+ return !record.projectid && (record.account !==
user.userInfo.account && !['Admin',
'DomainAdmin'].includes(user.userInfo.roletype))
+ },
groupAction: true,
popup: true,
groupMap: (selection) => { return selection.map(x => { return { id:
x } }) }