mirror of
https://github.com/goharbor/harbor
synced 2025-04-16 03:42:29 +00:00
Fix bug #4688
Fix bug: the user can push images although he have no permisson by checking empty value before assign permissions.
This commit is contained in:
parent
42ff98cb35
commit
f6bd2f245d
|
@ -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