Edgewall Software

Opened 15 years ago

Last modified 12 years ago

#8036 closed enhancement

allow IPermissionRequestor to extend existing meta-permissions — at Version 8

Reported by: Stephen Compall <stephen.compall@…> 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:
Internal Changes:

Description (last modified by Remy Blank)

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 IPermissionRequestors.

Change History (10)

by Stephen Compall <stephen.compall@…>, 15 years ago

patch with unit testing

comment:1 by Stephen Compall <stephen.compall@…>, 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 anonymous, 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 Christian Boos, 15 years ago

Milestone: 0.13

comment:4 by Christian Boos, 15 years ago

Keywords: permission added

comment:5 by Remy Blank, 14 years ago

Owner: set to Remy Blank

Interesting.

comment:6 by Felix Schwarz, 14 years ago

Cc: felix.schwarz@… 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 Remy Blank, 14 years ago

Milestone: next-major-0.1X0.13
Priority: normalhigh

A gentle push, as you just did :)

comment:8 by Remy Blank, 14 years ago

Description: modified (diff)

by Remy Blank, 14 years ago

Updated patch, refactors parts of PermissionSystem.

Note: See TracTickets for help on using tickets.