Skip to content

Commit

Permalink
Fix to allow actions on the network if it belongs to a project (#9550)
Browse files Browse the repository at this point in the history
  • Loading branch information
harikrishna-patnala authored Aug 21, 2024
1 parent b105716 commit f5c7729
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ui/src/config/section/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')))
},
Expand All @@ -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) {
Expand Down Expand Up @@ -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 } }) }
Expand Down

0 comments on commit f5c7729

Please sign in to comment.