summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/repo.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index c6c5d4aec3..044b1e9c18 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -257,13 +257,15 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
return
}
- isOwner, err := org.IsOwnedBy(ctx.User.ID)
- if err != nil {
- ctx.ServerError("IsOwnedBy", err)
- return
- } else if !isOwner {
- ctx.Error(403, "", "Given user is not owner of organization.")
- return
+ if !ctx.User.IsAdmin {
+ isOwner, err := org.IsOwnedBy(ctx.User.ID)
+ if err != nil {
+ ctx.ServerError("IsOwnedBy", err)
+ return
+ } else if !isOwner {
+ ctx.Error(403, "", "Given user is not owner of organization.")
+ return
+ }
}
CreateUserRepo(ctx, org, opt)
}