Fix migrate volume permissions (#6224)

* changed when to show migrate volume button on the UI.

Co-authored-by: Joao <JoaoJandre@gitlab.com>
This commit is contained in:
João Jandre 2022-09-27 05:26:07 -03:00 committed by GitHub
parent 697e12f8f7
commit 8ab8fdc1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -245,3 +245,9 @@ ALTER TABLE `cloud`.`vpc`
ADD COLUMN `dns2` varchar(255) DEFAULT NULL COMMENT 'second IPv4 DNS for the vpc' AFTER `dns1`,
ADD COLUMN `ip6dns1` varchar(255) DEFAULT NULL COMMENT 'first IPv6 DNS for the vpc' AFTER `dns2`,
ADD COLUMN `ip6dns2` varchar(255) DEFAULT NULL COMMENT 'second IPv6 DNS for the vpc' AFTER `ip6dns1`;
-- Fix migrateVolume permissions #6224.
DELETE role_perm
FROM role_permissions role_perm
INNER JOIN roles ON role_perm.role_id = roles.id
WHERE roles.role_type != 'Admin' AND roles.is_default = 1 AND role_perm.rule = 'migrateVolume';

View File

@ -188,12 +188,13 @@ export default {
},
{
api: 'migrateVolume',
permission: ['migrateVolume', 'findStoragePoolsForMigration', 'listStoragePools', 'listDiskOfferings'],
icon: 'drag-outlined',
docHelp: 'adminguide/storage.html#id2',
label: 'label.migrate.volume',
args: ['volumeid', 'storageid', 'livemigrate'],
dataView: true,
show: (record, store) => { return record.state === 'Ready' && ['Admin'].includes(store.userInfo.roletype) },
show: (record, store) => { return record.state === 'Ready' },
popup: true,
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/MigrateVolume.vue')))
},