comparison doc/customizing.txt @ 3079:64df8d65cc54

fix "Users may only edit their issues"
author Richard Jones <richard@users.sourceforge.net>
date Wed, 05 Jan 2005 22:35:31 +0000
parents 230f7394cce9
children 7b3f1a610d9c
comparison
equal deleted inserted replaced
3078:2fee36128471 3079:64df8d65cc54
1 =================== 1 ===================
2 Customising Roundup 2 Customising Roundup
3 =================== 3 ===================
4 4
5 :Version: $Revision: 1.163 $ 5 :Version: $Revision: 1.164 $
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/