Web editor: disallow edit mirror repository

This commit is contained in:
Unknwon 2016-08-28 04:56:41 -07:00
parent ba27d71abe
commit 579e5e4fee
7 changed files with 36 additions and 25 deletions

View file

@ -511,7 +511,7 @@ func runWeb(ctx *cli.Context) error {
// m.Post("/upload-file", repo.UploadFileToServer)
// m.Post("/upload-remove", bindIgnErr(auth.RemoveUploadFileForm{}), repo.RemoveUploadFileFromServer)
}, reqRepoWriter, context.RepoRef(), func(ctx *context.Context) {
if ctx.Repo.IsViewCommit {
if !ctx.Repo.Repository.CanEnableEditor() || ctx.Repo.IsViewCommit {
ctx.Handle(404, "", nil)
return
}