comparison roundup/cgi/client.py @ 8505:299edbd03ddf

bug: rearrange test condition to optimize test w/ most likely to fail first and expensive permission check last
author John Rouillard <rouilj@ieee.org>
date Tue, 23 Dec 2025 22:11:23 -0500
parents dfecb240bc34
children b6c6891754e9
comparison
equal deleted inserted replaced
8504:e331be9bc473 8505:299edbd03ddf
1402 if action in ('login', 'register'): 1402 if action in ('login', 'register'):
1403 return 1403 return
1404 1404
1405 # allow Anonymous to view the "user" "register" template if they're 1405 # allow Anonymous to view the "user" "register" template if they're
1406 # allowed to register 1406 # allowed to register
1407 if (self.db.security.hasPermission('Register', self.userid, 'user') 1407 if (self.template == 'register' and self.classname == 'user'
1408 and self.classname == 'user' and self.template == 'register'): 1408 and self.db.security.hasPermission('Register',
1409 self.userid, 'user')):
1409 return 1410 return
1410 1411
1411 # otherwise for everything else 1412 # otherwise for everything else
1412 if self.user == 'anonymous' and \ 1413 if self.user == 'anonymous' and \
1413 not self.db.security.hasPermission('Web Access', self.userid): 1414 not self.db.security.hasPermission('Web Access', self.userid):

Roundup Issue Tracker: http://roundup-tracker.org/