--- a/selectors.py Wed Sep 29 12:53:30 2010 +0200
+++ b/selectors.py Wed Sep 29 12:54:35 2010 +0200
@@ -1073,7 +1073,9 @@
for i, row in enumerate(rset):
if not rset.description[i][col] in need_local_check:
continue
- if not self.score(req, rset, i, col):
+ # micro-optimisation instead of calling self.score(req,
+ # rset, i, col): rset may be large
+ if not rset.get_entity(i, col).cw_has_perm(action):
return 0
score += 1
return score
--- a/server/test/unittest_repository.py Wed Sep 29 12:53:30 2010 +0200
+++ b/server/test/unittest_repository.py Wed Sep 29 12:54:35 2010 +0200
@@ -158,7 +158,7 @@
def test_rollback_on_execute_unauthorized(self):
class UnauthorizedAfterHook(Hook):
- __regid__ = 'valerror-after-hook'
+ __regid__ = 'unauthorized-after-hook'
__select__ = Hook.__select__ & is_instance('CWGroup')
events = ('after_update_entity',)
def __call__(self):