mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
Merge pull request #6378 from cd1989/retag-status-code-fix
Fix status code for permission check in retag, use 403
This commit is contained in:
commit
a3f424f5f3
@ -479,14 +479,14 @@ func (ra *RepositoryAPI) Retag() {
|
||||
// Check whether use has read permission to source project
|
||||
if !ra.SecurityCtx.HasReadPerm(srcImage.Project) {
|
||||
log.Errorf("user has no read permission to project '%s'", srcImage.Project)
|
||||
ra.HandleUnauthorized()
|
||||
ra.HandleForbidden(ra.SecurityCtx.GetUsername())
|
||||
return
|
||||
}
|
||||
|
||||
// Check whether user has write permission to target project
|
||||
if !ra.SecurityCtx.HasWritePerm(project) {
|
||||
log.Errorf("user has no write permission to project '%s'", project)
|
||||
ra.HandleUnauthorized()
|
||||
ra.HandleForbidden(ra.SecurityCtx.GetUsername())
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user