mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-01 23:07:39 +02: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{}
|
roles := []string{}
|
||||||
for _, project := range a.Projects {
|
for _, project := range a.Projects {
|
||||||
p := convertProject(project)
|
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...)
|
roles = append(roles, project.Roles...)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user