Browse Source

Merge pull request #2445 from bkcsoft/feature/fix-2442

Admins are allowed to create repos for arbitrary Orgs
Unknwon 9 years ago
parent
commit
1372cab35a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      routers/repo/repo.go

+ 1 - 1
routers/repo/repo.go

@@ -57,7 +57,7 @@ func checkContextUser(ctx *middleware.Context, uid int64) *models.User {
 	}
 
 	// Check ownership of organization.
-	if !org.IsOrganization() || !org.IsOwnedBy(ctx.User.Id) {
+	if !org.IsOrganization() || !(ctx.User.IsAdmin || org.IsOwnedBy(ctx.User.Id)) {
 		ctx.Error(403)
 		return nil
 	}