Opened 3 years ago

Closed 3 years ago

Last modified 6 months ago

#8609 closed enhancement (fixed)

Add permission-depended "my template" support

Reported by: hasienda Owned by: richard
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 3 years ago by richard

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:2 Changed 6 months ago by rjollos

In 13633:

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

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from richard. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.