mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-01 23:07:39 +02:00
commit
5792829951
@ -76,7 +76,7 @@ func (a *AuthContext) GetProjectRoles(projectIDOrName interface{}) []int {
|
||||
roles := []string{}
|
||||
for _, project := range a.Projects {
|
||||
p := convertProject(project)
|
||||
if p.ProjectID == id || p.Name == name {
|
||||
if id != 0 && p.ProjectID == id || len(name) > 0 && p.Name == name {
|
||||
roles = append(roles, project.Roles...)
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user