comparison doc/customizing.txt @ 1150:22c78fb54af4

more doc
author Richard Jones <richard@users.sourceforge.net>
date Mon, 16 Sep 2002 04:30:45 +0000
parents 7ae32787d981
children 7e0024954954
comparison
equal deleted inserted replaced
1149:7ae32787d981 1150:22c78fb54af4
1 =================== 1 ===================
2 Customising Roundup 2 Customising Roundup
3 =================== 3 ===================
4 4
5 :Version: $Revision: 1.38 $ 5 :Version: $Revision: 1.39 $
6 6
7 .. This document borrows from the ZopeBook section on ZPT. The original is at: 7 .. This document borrows from the ZopeBook section on ZPT. The original is at:
8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
9 9
10 .. contents:: 10 .. contents::
1819 </table> 1819 </table>
1820 1820
1821 Restricting the list of users that are assignable to a task 1821 Restricting the list of users that are assignable to a task
1822 ----------------------------------------------------------- 1822 -----------------------------------------------------------
1823 1823
1824 1. create a new Role, say "Developer":: 1824 1. In your tracker's "dbinit.py", create a new Role, say "Developer"::
1825 1825
1826 db.security.addRole(name='Developer', description='A developer') 1826 db.security.addRole(name='Developer', description='A developer')
1827 1827
1828 2. create a new Permission, say "Fixer", specific to "issue":: 1828 2. Just after that, create a new Permission, say "Fixer", specific to "issue"::
1829 1829
1830 p = db.security.addPermission(name='Fixer', klass='issue', 1830 p = db.security.addPermission(name='Fixer', klass='issue',
1831 description='User is allowed to be assigned to fix issues') 1831 description='User is allowed to be assigned to fix issues')
1832 1832
1833 3. assign the new Permission to your "Developer" Role:: 1833 3. Then assign the new Permission to your "Developer" Role::
1834 1834
1835 db.security.addPermissionToRole('Developer', p) 1835 db.security.addPermissionToRole('Developer', p)
1836 1836
1837 4. use the new Permission in restricting the "assignedto" list in the issue 1837 4. In the issue item edit page ("html/issue.item" in your tracker dir), use
1838 item edit page:: 1838 the new Permission in restricting the "assignedto" list::
1839 1839
1840 <select name="assignedto"> 1840 <select name="assignedto">
1841 <option value="-1">- no selection -</option> 1841 <option value="-1">- no selection -</option>
1842 <tal:block tal:repeat="user db/user/list"> 1842 <tal:block tal:repeat="user db/user/list">
1843 <option tal:condition="python:user.hasPermission('Fixer', context.classname)" 1843 <option tal:condition="python:user.hasPermission('Fixer', context.classname)"
1846 tal:content="user/realname"></option> 1846 tal:content="user/realname"></option>
1847 </tal:block> 1847 </tal:block>
1848 </select> 1848 </select>
1849 1849
1850 For extra security, you may wish to set up an auditor to enforce the 1850 For extra security, you may wish to set up an auditor to enforce the
1851 Permission requirement:: 1851 Permission requirement (install this as "assignedtoFixer.py" in your tracker
1852 "detectors" directory)::
1852 1853
1853 def assignedtoMustBeFixer(db, cl, nodeid, newvalues): 1854 def assignedtoMustBeFixer(db, cl, nodeid, newvalues):
1854 ''' Ensure the assignedto value in newvalues is a used with the Fixer 1855 ''' Ensure the assignedto value in newvalues is a used with the Fixer
1855 Permission 1856 Permission
1856 ''' 1857 '''

Roundup Issue Tracker: http://roundup-tracker.org/