little-cui commented on code in PR #1355:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1355#discussion_r1017560595


##########
datasource/etcd/role.go:
##########
@@ -156,3 +166,30 @@ func (rm *RbacDAO) UpdateRole(ctx context.Context, name 
string, role *crbac.Role
        opts = append(opts, syncOpts...)
        return etcdadpt.Txn(ctx, opts)
 }
+func (rm *RbacDAO) Migrate(ctx context.Context) error {

Review Comment:
   写UT



##########
datasource/rbac/role.go:
##########
@@ -38,4 +38,5 @@ type RoleManager interface {
        ListRole(ctx context.Context) ([]*rbac.Role, int64, error)
        DeleteRole(ctx context.Context, name string) (bool, error)
        UpdateRole(ctx context.Context, name string, role *rbac.Role) error
+       Migrate(ctx context.Context) error

Review Comment:
   改名MigrateOldRoles



##########
server/service/rbac/role_service.go:
##########
@@ -157,3 +158,22 @@ func RoleUsage(ctx context.Context) (int64, error) {
        }
        return used, nil
 }
+
+func MigrateOldRole() {

Review Comment:
   改名migrateOldRoles



##########
server/service/rbac/rbac.go:
##########
@@ -57,6 +57,7 @@ func Init() {
        if err != nil {
                log.Fatal("can not enable auth module", err)
        }
+       MigrateOldRole()

Review 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