﻿id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
8609	"Add permission-depended ""my template"" support"	hasienda	richard	"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.
{{{
#!diff
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
}}}"	enhancement	closed	normal	TracTicketTemplatePlugin	normal	fixed	permission user templates		0.11
