#1511 Allow local import only for admin users

This commit is contained in:
Unknwon 2015-11-03 18:40:52 -05:00
parent 25ec20d525
commit 6f0a41b8b2
18 changed files with 152 additions and 79 deletions

View file

@ -420,7 +420,7 @@ func RequireRepoAdmin() macaron.Handler {
// GitHookService checks if repository Git hooks service has been enabled.
func GitHookService() macaron.Handler {
return func(ctx *Context) {
if !ctx.User.AllowGitHook && !ctx.User.IsAdmin {
if !ctx.User.CanEditGitHook() {
ctx.Handle(404, "GitHookService", nil)
return
}