Skip to content

Commit 8ab8fdc

Browse files
JoaoJandreJoao
andauthored
Fix migrate volume permissions (#6224)
* changed when to show migrate volume button on the UI. Co-authored-by: Joao <JoaoJandre@gitlab.com>
1 parent 697e12f commit 8ab8fdc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

engine/schema/src/main/resources/META-INF/db/schema-41710to41800.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,9 @@ ALTER TABLE `cloud`.`vpc`
245245
ADD COLUMN `dns2` varchar(255) DEFAULT NULL COMMENT 'second IPv4 DNS for the vpc' AFTER `dns1`,
246246
ADD COLUMN `ip6dns1` varchar(255) DEFAULT NULL COMMENT 'first IPv6 DNS for the vpc' AFTER `dns2`,
247247
ADD COLUMN `ip6dns2` varchar(255) DEFAULT NULL COMMENT 'second IPv6 DNS for the vpc' AFTER `ip6dns1`;
248+
249+
-- Fix migrateVolume permissions #6224.
250+
DELETE role_perm
251+
FROM role_permissions role_perm
252+
INNER JOIN roles ON role_perm.role_id = roles.id
253+
WHERE roles.role_type != 'Admin' AND roles.is_default = 1 AND role_perm.rule = 'migrateVolume';

ui/src/config/section/storage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,13 @@ export default {
188188
},
189189
{
190190
api: 'migrateVolume',
191+
permission: ['migrateVolume', 'findStoragePoolsForMigration', 'listStoragePools', 'listDiskOfferings'],
191192
icon: 'drag-outlined',
192193
docHelp: 'adminguide/storage.html#id2',
193194
label: 'label.migrate.volume',
194195
args: ['volumeid', 'storageid', 'livemigrate'],
195196
dataView: true,
196-
show: (record, store) => { return record.state === 'Ready' && ['Admin'].includes(store.userInfo.roletype) },
197+
show: (record, store) => { return record.state === 'Ready' },
197198
popup: true,
198199
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/MigrateVolume.vue')))
199200
},

0 commit comments

Comments
 (0)