summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r--routers/api/v1/repo/repo.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 05ab9cb38b..e2a3bfc873 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -322,12 +322,12 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
}
if !ctx.User.IsAdmin {
- isOwner, err := org.IsOwnedBy(ctx.User.ID)
+ canCreate, err := org.CanCreateOrgRepo(ctx.User.ID)
if err != nil {
- ctx.ServerError("IsOwnedBy", err)
+ ctx.ServerError("CanCreateOrgRepo", err)
return
- } else if !isOwner {
- ctx.Error(403, "", "Given user is not owner of organization.")
+ } else if !canCreate {
+ ctx.Error(403, "", "Given user is not allowed to create repository in organization.")
return
}
}