Skip to content

Commit

Permalink
Update handling of usernames in rbacUser.go
Browse files Browse the repository at this point in the history
Adjusted the GetUserName method in rbacUser.go to replace commas with underscores. This fixes a bug with commas in usernames.
  • Loading branch information
Xaseron committed Sep 14, 2023
1 parent b3a176c commit a4b40f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/rbac/project/rbac_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package project
import (
"github.com/goharbor/harbor/src/pkg/permission/types"
"github.com/goharbor/harbor/src/pkg/project/models"
"strings"
)

type rbacUser struct {
Expand All @@ -28,7 +29,7 @@ type rbacUser struct {

// GetUserName returns username of the visitor
func (pru *rbacUser) GetUserName() string {
return pru.username
return strings.ReplaceAll(pru.username, ",", "_")
}

// GetPolicies returns policies of the visitor
Expand Down

0 comments on commit a4b40f3

Please sign in to comment.