comparison mercurial/hgweb/hgweb_mod.py @ 7575:3ccaefc84f45

hgweb: fix long line lengths introduced in 2dc868712dcc
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sat, 03 Jan 2009 21:44:15 +0100
parents bbcd2dea19fe
children 08cabecfa8a8
comparison
equal deleted inserted replaced
7574:4afc3208a7b8 7575:3ccaefc84f45
282 deny_read = self.configlist('web', 'deny_read') 282 deny_read = self.configlist('web', 'deny_read')
283 if deny_read and (not user or deny_read == ['*'] or user in deny_read): 283 if deny_read and (not user or deny_read == ['*'] or user in deny_read):
284 raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') 284 raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized')
285 285
286 allow_read = self.configlist('web', 'allow_read') 286 allow_read = self.configlist('web', 'allow_read')
287 result = (not allow_read) or (allow_read == ['*']) or (user in allow_read) 287 result = (not allow_read) or (allow_read == ['*'])
288 if not result: 288 if not result or user in allow_read:
289 raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') 289 raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized')
290 290
291 if op == 'pull' and not self.allowpull: 291 if op == 'pull' and not self.allowpull:
292 raise ErrorResponse(HTTP_UNAUTHORIZED, 'pull not authorized') 292 raise ErrorResponse(HTTP_UNAUTHORIZED, 'pull not authorized')
293 # op is None when checking allow/deny_read permissions for a web-browser request 293 elif op == 'pull' or op is None: # op is None for interface requests
294 elif op == 'pull' or op is None:
295 return 294 return
296 295
297 # enforce that you can only push using POST requests 296 # enforce that you can only push using POST requests
298 if req.env['REQUEST_METHOD'] != 'POST': 297 if req.env['REQUEST_METHOD'] != 'POST':
299 msg = 'push requires POST request' 298 msg = 'push requires POST request'