Repo permission bug fixes (#513)

This commit is contained in:
Ethan Koenig 2016-12-29 08:17:32 -05:00 committed by Lunny Xiao
parent ac51caa517
commit 6f4ba6884c
3 changed files with 7 additions and 35 deletions

View file

@ -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