sureshanaparti commented on a change in pull request #4071:
URL: https://github.com/apache/cloudstack/pull/4071#discussion_r439191916



##########
File path: engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql
##########
@@ -18,3 +18,81 @@
 --;
 -- Schema upgrade from 4.14.0.0 to 4.15.0.0
 --;
+
+ALTER TABLE `cloud`.`roles` ADD COLUMN `is_default` tinyint(1) NOT NULL 
DEFAULT '0' COMMENT 'is this a default role';
+UPDATE `cloud`.`roles` SET `is_default` = 1 WHERE id IN (1, 2, 3, 4);
+
+-- Updated Default CloudStack roles with read-only and support admin and user 
roles
+INSERT INTO `cloud`.`roles` (`uuid`, `name`, `role_type`, `description`, 
`is_default`) VALUES (UUID(), 'Read-Only Admin', 'Admin', 'Default read-only 
admin role', 1) ON DUPLICATE KEY UPDATE name=name;
+INSERT INTO `cloud`.`roles` (`uuid`, `name`, `role_type`, `description`, 
`is_default`) VALUES (UUID(), 'Read-Only User', 'User', 'Default read-only user 
role', 1) ON DUPLICATE KEY UPDATE name=name;
+INSERT INTO `cloud`.`roles` (`uuid`, `name`, `role_type`, `description`, 
`is_default`) VALUES (UUID(), 'Admin-Support', 'Admin', 'Default admin support 
role', 1) ON DUPLICATE KEY UPDATE name=name;
+INSERT INTO `cloud`.`roles` (`uuid`, `name`, `role_type`, `description`, 
`is_default`) VALUES (UUID(), 'User-Support', 'User', 'Default user support 
role', 1) ON DUPLICATE KEY UPDATE name=name;
+
+-- Role permissions for Read-Only Admin
+SELECT id INTO @ReadOnlyAdminRoleId FROM `cloud`.`roles` WHERE name = 
'Read-Only Admin' AND is_default = 1;
+SELECT @ReadOnlyAdminSortOrder:=-1;

Review comment:
       @rhtyd Moved permissions update to the Upgrade* class. Please check. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to