#8036 closed enhancement (fixed)
allow IPermissionRequestor to extend existing meta-permissions — at Version 11
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | general | Version: | 0.11.2.1 |
Severity: | normal | Keywords: | patch permission |
Cc: | felix.schwarz@…, leho@… | Branch: | |
Release Notes: | |||
API Changes: |
perm: Made meta-permissions cumulative, so e.g. |
||
Internal Changes: |
Description (last modified by )
Sometimes you might want to introduce a new kind of ticket permission, and add it to TICKET_ADMIN
without having to wholly redefine it. A good illustration comes from a test IPermissionRequestor
I have defined:
def get_permission_actions(self): return ['TEST_CREATE', 'TEST_DELETE', 'TEST_MODIFY', ('TEST_CREATE', []), ('TEST_ADMIN', ['TEST_CREATE', 'TEST_DELETE']), ('TEST_ADMIN', ['TEST_MODIFY'])]
Except with the imagination that TEST_CREATE
actually has something, and the TEST_ADMIN
variants are in separate IPermissionRequestor
s.
Change History (14)
by , 15 years ago
Attachment: | perm-action-alias-extension.diff added |
---|
comment:1 by , 15 years ago
Keywords: | patch added |
---|
The attached patch documents the extension to get_permission_actions
's capabilities, tweaks get_actions
and expand_actions
, mostly rewrites TicketSystem.get_user_permissions
, and a test support code change (shown in description) that causes test_meta_permissions
to fail if the remainder of the patch is not present.
comment:2 by , 15 years ago
Apologies, I forgot to remove the -
-lines from the diff. Here is the corrected example:
def get_permission_actions(self): return ['TEST_CREATE', 'TEST_DELETE', 'TEST_MODIFY', ('TEST_CREATE', []), ('TEST_ADMIN', ['TEST_CREATE', 'TEST_DELETE']), ('TEST_ADMIN', ['TEST_MODIFY'])]
comment:3 by , 15 years ago
Milestone: | → 0.13 |
---|
comment:4 by , 15 years ago
Keywords: | permission added |
---|
follow-up: 10 comment:6 by , 14 years ago
Cc: | added |
---|
what's necessary to get this patch in? I'd like to see this fixed. Is it just a code review that's missing?
comment:7 by , 14 years ago
Milestone: | next-major-0.1X → 0.13 |
---|---|
Priority: | normal → high |
A gentle push, as you just did :)
comment:8 by , 14 years ago
Description: | modified (diff) |
---|
by , 14 years ago
Attachment: | 8036-perm-extension-r10316.patch added |
---|
Updated patch, refactors parts of PermissionSystem
.
comment:9 by , 14 years ago
The initial patch didn't apply cleanly anymore, so I had to dig deeper into PermissionSystem
. It turns out that it could be cleaned up quite a bit (mostly by removing duplication).
8036-perm-extension-r10316.patch implements the requested functionality and passes all tests. As the permission subsystem is quite critical, it would be great if I could get some review and testing, especially from someone using authz_policy.
by , 13 years ago
Attachment: | 8036-perm-extension-r10380.patch added |
---|
Updated patch for current trunk.
comment:10 by , 13 years ago
Replying to fschwarz:
what's necessary to get this patch in? I'd like to see this fixed. Is it just a code review that's missing?
Yes, the code review is all that's missing (hint, hint :)
comment:11 by , 13 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Patch applied in [10417].
patch with unit testing