Ticket #7201 (closed defect: fixed)
PermissionCache doesn't cache when created with __call__
| Reported by: | Stephen Compall <stephen.compall@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | highest | Milestone: | 0.11 |
| Component: | general | Version: | 0.11rc1 |
| Severity: | minor | Keywords: | permission patch |
| Cc: |
Description
Discovered in my logs after a user report:
2008-05-06 19:37:35,544 Trac[perm] DEBUG: No policy allowed <redacted> performing TICKET_MODIFY on <Resource 'ticket'> (repeat 18 times with different timestamps)
I have an IPermissionPolicy that requests actions on perm('ticket') to find them for perm('ticket', id), and then performs an expensive test when that answers false, hence creating the performance issue reported by my user for viewing a single ticket (besides being called multiple times in the first place).
As I see it, the issue is:
>>> cache = {}
>>> cache is not None and cache or 0
0
(i.e. {} is false) and is fixed in the attached patch.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


