|
2 | 2 | Customising Roundup |
3 | 3 | =================== |
4 | 4 |
|
5 | | -:Version: $Revision: 1.35 $ |
| 5 | +:Version: $Revision: 1.36 $ |
6 | 6 |
|
7 | 7 | .. This document borrows from the ZopeBook section on ZPT. The original is at: |
8 | 8 | 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: |
652 | 652 | **style.css** |
653 | 653 | a static file that is served up as-is |
654 | 654 |
|
| 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 | + |
655 | 665 | How the templates work |
656 | 666 | ---------------------- |
657 | 667 |
|
@@ -1808,6 +1818,42 @@ Alter the issue.item template section for messages to:: |
1808 | 1818 | </tal:block> |
1809 | 1819 | </table> |
1810 | 1820 |
|
| 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 | + |
1811 | 1857 | ------------------- |
1812 | 1858 |
|
1813 | 1859 | Back to `Table of Contents`_ |
|
0 commit comments