Modify ↓
#8609 closed enhancement (fixed)
Add permission-depended "my template" support
Reported by: | Steffen Hoffmann | Owned by: | Richard Liao |
---|---|---|---|
Priority: | normal | Component: | TracTicketTemplatePlugin |
Severity: | normal | Keywords: | permission user templates |
Cc: | Trac Release: | 0.11 |
Description
I've found it useful to have more fine-grained control over who is allowed to see 'my templates" user level ticket templates.
This is partly a follow-up to #8339, where I started working on permissions. Here I propose a new 'TT_USER' permission that will be required in addition to enable_custom = true
(in trac.ini
) in order to show the "my templates" drop-down field. The patch from #8339 is included here too for convenience.
tickettemplate/ttadmin.py 2011-03-15 23:28:55.000000000 +0100 @@ -70,7 +70,7 @@ # IPermissionRequestor methods def get_permission_actions(self): - actions = ['TT_ADMIN'] + actions = ['TT_USER', ('TT_ADMIN', ['TT_USER'])] return actions # IEnvironmentSetupParticipant methods @@ -133,7 +133,7 @@ # IAdminPanelProvider methods def get_admin_panels(self, req): - if 'TRAC_ADMIN' in req.perm: + if 'TT_ADMIN' in req.perm: yield ('ticket', _('Ticket System'), 'tickettemplate', _('Ticket Template')) def render_admin_panel(self, req, cat, page, path_info): @@ -250,6 +250,7 @@ result["status"] = "1" result["field_list"] = self._getFieldList() if self.config.getbool("tickettemplate", "enable_custom", True): + req.perm.assert_permission('TT_USER') result["enable_custom"] = True else: result["enable_custom"] = False
Attachments (0)
Note: See
TracTickets for help on using
tickets.
(In [9956]) Fixed #8609 , add permission TT_USER to fine grained control user custom templates