comparison doc/customizing.txt @ 1149:7ae32787d981

more doc
author Richard Jones <richard@users.sourceforge.net>
date Mon, 16 Sep 2002 04:28:59 +0000
parents 20d42d7e4642
children 22c78fb54af4
comparison
equal deleted inserted replaced
1148:20d42d7e4642 1149:7ae32787d981
1 =================== 1 ===================
2 Customising Roundup 2 Customising Roundup
3 =================== 3 ===================
4 4
5 :Version: $Revision: 1.37 $ 5 :Version: $Revision: 1.38 $
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::
1845 selected python:user.id == context.assignedto" 1845 selected python:user.id == context.assignedto"
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 overload the hasEditItemPermission method 1850 For extra security, you may wish to set up an auditor to enforce the
1851 on your tracker's interfaces.Client class to enforce the Permission 1851 Permission requirement::
1852 requirement:: 1852
1853 1853 def assignedtoMustBeFixer(db, cl, nodeid, newvalues):
1854 XXX 1854 ''' Ensure the assignedto value in newvalues is a used with the Fixer
1855 Permission
1856 '''
1857 if not newvalues.has_key('assignedto'):
1858 # don't care
1859 return
1860
1861 # get the userid
1862 userid = newvalues['assignedto']
1863 if not db.security.hasPermission('Fixer', userid, cl.classname):
1864 raise ValueError, 'You do not have permission to edit %s'%cl.classname
1865
1866 def init(db):
1867 db.issue.audit('set', assignedtoMustBeFixer)
1868 db.issue.audit('create', assignedtoMustBeFixer)
1869
1870 So now, if the edit attempts to set the assignedto to a user that doesn't have
1871 the "Fixer" Permission, the error will be raised.
1855 1872
1856 1873
1857 ------------------- 1874 -------------------
1858 1875
1859 Back to `Table of Contents`_ 1876 Back to `Table of Contents`_

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