Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#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


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/   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
                 result["enable_custom"] = False

Attachments (0)

Change History (2)

comment:1 Changed 11 years ago by Richard Liao

Resolution: fixed
Status: newclosed

(In [9956]) Fixed #8609 , add permission TT_USER to fine grained control user custom templates

comment:2 Changed 8 years ago by Ryan J Ollos

In 13633:

0.8: Bump version to 0.8. Added SVN revision to egg. Refs #6589, #6809, #7311, #7404, #7440, #8555, #8609, #9238, #10858.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Richard Liao.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.