comparison doc/customizing.txt @ 3080:abdeb9b0e53a maint-0.8

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Wed, 05 Jan 2005 22:36:30 +0000
parents 70c9954f619f
children 5b0f7f1cc3cb
comparison
equal deleted inserted replaced
3075:326ad9da0b75 3080:abdeb9b0e53a
1 =================== 1 ===================
2 Customising Roundup 2 Customising Roundup
3 =================== 3 ===================
4 4
5 :Version: $Revision: 1.161.2.2 $ 5 :Version: $Revision: 1.161.2.3 $
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::
3929 # and view their own 3929 # and view their own
3930 db.security.addPermissionToRole('Provisional User', 'Create', 'issue') 3930 db.security.addPermissionToRole('Provisional User', 'Create', 'issue')
3931 def own_issue(db, userid, itemid): 3931 def own_issue(db, userid, itemid):
3932 '''Determine whether the userid matches the creator of the issue.''' 3932 '''Determine whether the userid matches the creator of the issue.'''
3933 return userid == db.issue.get(itemid, 'creator') 3933 return userid == db.issue.get(itemid, 'creator')
3934 p = db.security.addPermission(name='Edit Own Issues', klass='issue', 3934 p = db.security.addPermission(name='Edit', klass='issue',
3935 code=own_issue, description='Can only edit own issues') 3935 code=own_issue, description='Can only edit own issues')
3936 db.security.addPermissionToRole('Provisional User', p) 3936 db.security.addPermissionToRole('Provisional User', p)
3937 p = db.security.addPermission(name='View Own Issues', klass='issue', 3937 p = db.security.addPermission(name='View', klass='issue',
3938 code=own_issue, description='Can only view own issues') 3938 code=own_issue, description='Can only view own issues')
3939 db.security.addPermissionToRole('Provisional User', p) 3939 db.security.addPermissionToRole('Provisional User', p)
3940 3940
3941 # Assign the Permissions for issue-related classes 3941 # Assign the Permissions for issue-related classes
3942 for cl in 'file', 'msg', 'query', 'keyword': 3942 for cl in 'file', 'msg', 'query', 'keyword':

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