#438: Implement and enforce product permission policy
---------------------------+---------------------------------
Reporter: olemis | Owner: olemis
Type: task | Status: assigned
Priority: critical | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: permission security
---------------------------+---------------------------------
Changes (by jure):
* status: review => assigned
* owner: jure => olemis
Comment:
Patch applied, causes this failure in test suite:
{{{
======================================================================
ERROR: test_available_actions_isolation
(tests.ticket.api.ProductTicketSystemTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/path/to/bloodhound/bloodhound_multiproduct/tests/ticket/api.py",
line 81, in test_available_actions_isolation
self.assertEqual(['leave'], self._get_actions({'status': 'closed'}))
File "/path/to/bloodhound/trac/trac/ticket/tests/api.py", line 25, in
_get_actions
return ts.get_available_actions(self.req, Ticket(self.env, id))
File "/path/to/bloodhound/trac/trac/ticket/api.py", line 267, in
get_available_actions
weighted_actions = controller.get_ticket_actions(req, ticket) or []
File "/path/to/bloodhound/trac/trac/ticket/default_workflow.py", line
192, in get_ticket_actions
if self._is_action_allowed(ticket_perm, required_perms):
File /path/to/bloodhound/trac/trac/ticket/default_workflow.py", line
206, in _is_action_allowed
if permission in ticket_perm:
File "/path/to/bloodhound/trac/trac/perm.py", line 556, in
has_permission
return self._has_permission(action, resource)
File "/path/to/bloodhound/trac/trac/perm.py", line 570, in
_has_permission
check_permission(action, perm.username, resource, perm)
File "/path/to/bloodhound/trac/trac/perm.py", line 462, in
check_permission
perm)
File "/path/to/bloodhound/trac/trac/perm.py", line 296, in
check_permission
get_user_permissions(username)
File "/path/to/bloodhound/trac/trac/perm.py", line 391, in
get_user_permissions
actions = self.get_actions_dict()
File "/path/to/bloodhound/trac/trac/perm.py", line 359, in
get_actions_dict
for requestor in self.requestors:
File "/path/to/bloodhound/trac/trac/core.py", line 78, in extensions
components = [component.compmgr[cls] for cls in classes]
File "/path/to/bloodhound/trac/trac/core.py", line 215, in __getitem__
component = cls(self)
File
"/path/to/bloodhound/bloodhound_multiproduct/multiproduct/cache.py", line
54, in wrapper
key = keymap(args, kwds, kwd_mark)
File "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/env.py",
line 347, in product_env_keymap
if isinstance(args[1], Product):
IndexError: tuple index out of range
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/438#comment:5>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound (incubating) issue tracker