Menu

Commit [r6104]  Maximize  Restore  History

context-refactoring: modified the IPermissionPolicy interface so that plugins can easily check for extra permissions the standard way.

The `check_permission` method has changed from:
{{{
check_permission(username, action, resource)
}}}
to:
{{{
check_permission(action, perm)
}}}
with `perm` being the usual `PermissionCache` on which permissions checks can be made (`'...' in perm`).

As noted in the vulnerability_tickets.py plugin, some care should be taken to avoid recursion, though.

cboos 2007-10-26

changed /sandbox/context-refactoring/sample-plugins/authz_policy.py
changed /sandbox/context-refactoring/sample-plugins/vulnerability_tickets.py
changed /sandbox/context-refactoring/trac/attachment.py
changed /sandbox/context-refactoring/trac/perm.py
changed /sandbox/context-refactoring/trac/tests/perm.py
/sandbox/context-refactoring/sample-plugins/authz_policy.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/sample-plugins/vulnerability_tickets.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/attachment.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/perm.py Diff Switch to side-by-side view
Loading...
/sandbox/context-refactoring/trac/tests/perm.py Diff Switch to side-by-side view
Loading...