fuweng11 commented on code in PR #8100:
URL: https://github.com/apache/inlong/pull/8100#discussion_r1206356882


##########
inlong-manager/manager-dao/src/main/resources/mappers/UserRoleEntityMapper.xml:
##########


Review Comment:
   Rename UserRoleEntityMapper.xml to TenantUserRoleEntityMapper.xml.



##########
inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/UserRoleEntity.java:
##########


Review Comment:
   Rename UserRoleEntity to TenantUserRoleEntity.



##########
inlong-manager/manager-web/sql/changes-1.8.0.sql:
##########
@@ -44,4 +44,42 @@ CREATE TABLE IF NOT EXISTS `inlong_tenant`
   DEFAULT CHARSET = utf8 COMMENT ='Inlong tenant table';
 
 INSERT INTO `inlong_tenant`(`name`, `description`, `creator`, `modifier`)
-VALUES ('public', 'Default tenant', 'admin', 'admin');
\ No newline at end of file
+VALUES ('public', 'Default tenant', 'inlong_init', 'inlong_init');
+
+-- To support distinguish inlong user permission and tenant permission 
control, please see https://github.com/apache/inlong/issues/8098
+CREATE TABLE IF NOT EXISTS `inlong_user_role`
+(
+    `id`          int(11)      NOT NULL AUTO_INCREMENT,
+    `user_name`   varchar(256) NOT NULL COMMENT 'Username',
+    `role_code`   varchar(256) NOT NULL COMMENT 'User role code',
+    `disabled`    tinyint(1)   NOT NULL DEFAULT '0' COMMENT 'Whether to 
disabled, 0: enabled, 1: disabled',
+    `is_deleted`  int(11)               DEFAULT '0' COMMENT 'Whether to 
delete, 0 is not deleted, if greater than 0, delete',
+    `creator`     varchar(256) NOT NULL COMMENT 'Creator name',
+    `modifier`    varchar(256)          DEFAULT NULL COMMENT 'Modifier name',
+    `create_time` datetime     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 
'Create time',
+    `modify_time` datetime     NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP COMMENT 'Modify time',
+    `version`     int(11)      NOT NULL DEFAULT '1' COMMENT 'Version number, 
which will be incremented by 1 after modification',
+    PRIMARY KEY (`id`),
+    UNIQUE KEY `unique_tenant_user_role` (`user_name`, `role_code`, 
`is_deleted`)
+    ) ENGINE = InnoDB
+    DEFAULT CHARSET = utf8mb4 COMMENT ='Inlong User Role Table';
+
+INSERT INTO `inlong_user_role` (`user_name`, `role_code`, `creator`)
+VALUES ('admin', 'INLONG_ADMIN', 'inlong_init');
+
+RENAME TABLE user_role TO tenant_user_role;
+ALTER TABLE tenant_user_role
+    ADD tenant VARCHAR(256) DEFAULT 'public' NOT NULL comment 'User tenant';

Review Comment:
   `comment` to  `COMMENT`



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to