Skip to content

Commit

Permalink
set project owner id 0 for robot accounts
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Weber <[email protected]>
  • Loading branch information
phin1x committed Jun 27, 2021
1 parent 019b2cd commit f67197f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/v2.0/handler/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ func (a *projectAPI) CreateProject(ctx context.Context, params operation.CreateP
// set the owner as the system admin when the API being called by replication
// it's a solution to workaround the restriction of project creation API:
// only normal users can create projects
if secCtx.IsSolutionUser() || secCtx.Name() == "robot" {
if secCtx.Name() == "robot" {
ownerID = 0
} else if secCtx.IsSolutionUser() {
ownerID = 1
} else {
ownerName := secCtx.GetUsername()
Expand Down

0 comments on commit f67197f

Please sign in to comment.