Skip to content

Commit f47350a

Browse files
committed
bug: rearrange test condition to optimize test w/ most likely to fail first and expensive permission check last
1 parent 22f84a8 commit f47350a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

roundup/cgi/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,9 @@ def check_anonymous_access(self):
14041404

14051405
# allow Anonymous to view the "user" "register" template if they're
14061406
# allowed to register
1407-
if (self.db.security.hasPermission('Register', self.userid, 'user')
1408-
and self.classname == 'user' and self.template == 'register'):
1407+
if (self.template == 'register' and self.classname == 'user'
1408+
and self.db.security.hasPermission('Register',
1409+
self.userid, 'user')):
14091410
return
14101411

14111412
# otherwise for everything else

0 commit comments

Comments
 (0)