Explorar o código

Admins are allowed to create repos for arbitrary Orgs

Kim "BKC" Carlbäcker %!s(int64=9) %!d(string=hai) anos
pai
achega
a3eab8185d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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
 	}