Skip to content

Commit

Permalink
fix permission denied error for non existing projects (#17586) (#17619)
Browse files Browse the repository at this point in the history
Signed-off-by: Maksym Trofimenko <[email protected]>
  • Loading branch information
tpoxa authored Nov 14, 2022
1 parent 40ba15c commit 6b46b8b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server/v2.0/handler/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ func (b *BaseAPI) HasProjectPermission(ctx context.Context, projectIDOrName inte
p, err := baseProjectCtl.GetByName(ctx, projectName)
if err != nil {
log.Errorf("failed to get project %s: %v", projectName, err)
return false
if errors.IsNotFoundErr(err) {
p = &project.Project{}
} else {
return false
}
}
if p == nil {
log.Warningf("project %s not found", projectName)
Expand Down

0 comments on commit 6b46b8b

Please sign in to comment.