summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index cb4e483333..b78dd5376e 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -53,9 +53,9 @@ func MustBeAbleToUpload(ctx *context.Context) {
}
func checkContextUser(ctx *context.Context, uid int64) *models.User {
- orgs, err := models.GetOwnedOrgsByUserIDDesc(ctx.User.ID, "updated_unix")
+ orgs, err := models.GetOrgsCanCreateRepoByUserID(ctx.User.ID)
if err != nil {
- ctx.ServerError("GetOwnedOrgsByUserIDDesc", err)
+ ctx.ServerError("GetOrgsCanCreateRepoByUserID", err)
return nil
}
ctx.Data["Orgs"] = orgs
@@ -81,11 +81,11 @@ func checkContextUser(ctx *context.Context, uid int64) *models.User {
return nil
}
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 nil
- } else if !isOwner {
+ } else if !canCreate {
ctx.Error(403)
return nil
}