Skip to content

Commit fad9beb

Browse files
author
Richard Jones
committed
more doc
1 parent d68deea commit fad9beb

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

doc/customizing.txt

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.37 $
5+
:Version: $Revision: 1.38 $
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
@@ -1847,11 +1847,28 @@ Restricting the list of users that are assignable to a task
18471847
</tal:block>
18481848
</select>
18491849

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
1850+
For extra security, you may wish to set up an auditor to enforce the
1851+
Permission requirement::
1852+
1853+
def assignedtoMustBeFixer(db, cl, nodeid, newvalues):
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.
18551872

18561873

18571874
-------------------

0 commit comments

Comments
 (0)