diff options
author | Ethan Koenig <etk39@cornell.edu> | 2016-12-29 08:17:32 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2016-12-29 21:17:32 +0800 |
commit | 6f4ba6884c85e5603e7510c0e0d114bc9f86965f (patch) | |
tree | 429afe6210a210e1c3c53e539a447240fd1f47ae /routers/api/v1/repo/repo.go | |
parent | ac51caa517579ca9b495bff031b2affe297ebd25 (diff) | |
download | gitea-6f4ba6884c85e5603e7510c0e0d114bc9f86965f.tar.gz gitea-6f4ba6884c85e5603e7510c0e0d114bc9f86965f.zip |
Repo permission bug fixes (#513)
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r-- | routers/api/v1/repo/repo.go | 4 |
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 |