Ver Fonte

api/repo: fix admin migrate repo for non-org users (#4479)

Unknwon há 7 anos atrás
pai
commit
c0be055541
3 ficheiros alterados com 3 adições e 3 exclusões
  1. 1 1
      gogs.go
  2. 1 1
      routers/api/v1/repo/repo.go
  3. 1 1
      templates/.VERSION

+ 1 - 1
gogs.go

@@ -16,7 +16,7 @@ import (
 	"github.com/gogits/gogs/pkg/setting"
 )
 
-const APP_VER = "0.11.15.0605"
+const APP_VER = "0.11.16.0605"
 
 func init() {
 	setting.AppVer = APP_VER

+ 1 - 1
routers/api/v1/repo/repo.go

@@ -220,7 +220,7 @@ func Migrate(c *context.APIContext, f form.MigrateRepo) {
 				c.Error(500, "GetUserByID", err)
 			}
 			return
-		} else if !org.IsOrganization() {
+		} else if !org.IsOrganization() && !c.User.IsAdmin {
 			c.Error(403, "", "Given user is not an organization")
 			return
 		}

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.11.15.0605
+0.11.16.0605