Skip to content

Commit 313d56f

Browse files
author
Richard Jones
committed
more doc, "fixer" example
1 parent 2828492 commit 313d56f

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

doc/customizing.txt

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.35 $
5+
:Version: $Revision: 1.36 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -652,6 +652,16 @@ the tracker **html** directory. There are several types of files in there:
652652
**style.css**
653653
a static file that is served up as-is
654654

655+
Note: Remember tyhat you can create any template extension you want to, so
656+
if you just want to play around with the templating for new issues, you can
657+
copy the current "issue.item" template to "issue.test", and then access the
658+
test template using the ":template" URL argument::
659+
660+
http://your.tracker.example/tracker/issue?:template=test
661+
662+
and it won't affect your users using the "issue.item" template.
663+
664+
655665
How the templates work
656666
----------------------
657667

@@ -1808,6 +1818,42 @@ Alter the issue.item template section for messages to::
18081818
</tal:block>
18091819
</table>
18101820

1821+
Restricting the list of users that are assignable to a task
1822+
-----------------------------------------------------------
1823+
1824+
1. create a new Role, say "Developer"::
1825+
1826+
db.security.addRole(name='Developer', description='A developer')
1827+
1828+
2. create a new Permission, say "Fixer", specific to "issue"::
1829+
1830+
p = db.security.addPermission(name='Fixer', klass='issue',
1831+
description='User is allowed to be assigned to fix issues')
1832+
1833+
3. assign the new Permission to your "Developer" Role::
1834+
1835+
db.security.addPermissionToRole('Developer', p)
1836+
1837+
4. use the new Permission in restricting the "assignedto" list in the issue
1838+
item edit page::
1839+
1840+
<select name="assignedto">
1841+
<option value="-1">- no selection -</option>
1842+
<tal:block tal:repeat="user db/user/list">
1843+
<option tal:condition="python:user.hasPermission('Fixer', context.classname)"
1844+
tal:attributes="value user/id;
1845+
selected python:user.id == context.assignedto"
1846+
tal:content="user/realname"></option>
1847+
</tal:block>
1848+
</select>
1849+
1850+
For extra security, you may wish to overload the hasEditItemPermission method
1851+
on your tracker's interfaces.Client class to enforce the Permission
1852+
requirement::
1853+
1854+
XXX
1855+
1856+
18111857
-------------------
18121858

18131859
Back to `Table of Contents`_

0 commit comments

Comments
 (0)