diff -r e3c228b4510d -r ff4bc0ab6740 mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Tue Feb 20 18:54:27 2018 -0800 +++ b/mercurial/hgweb/hgweb_mod.py Tue Feb 20 18:55:58 2018 -0800 @@ -360,8 +360,10 @@ try: if query: raise ErrorResponse(HTTP_NOT_FOUND) + + req.checkperm = lambda op: self.check_perm(rctx, req, op) if cmd in perms: - self.check_perm(rctx, req, perms[cmd]) + req.checkperm(perms[cmd]) return protocol.call(rctx.repo, req, cmd) except ErrorResponse as inst: # A client that sends unbundle without 100-continue will