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.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 35e6554273..fea625fbe7 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -275,6 +275,10 @@ func GetByID(ctx *context.APIContext) {
// Delete one repository
// see https://github.com/gogits/go-gogs-client/wiki/Repositories#delete
func Delete(ctx *context.APIContext) {
+ if !ctx.Repo.IsAdmin() {
+ ctx.Error(403, "", "Must have admin rights")
+ return
+ }
owner := ctx.Repo.Owner
repo := ctx.Repo.Repository