comparison doc/customizing.txt @ 3262:62d58c72621b maint-0.8

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Tue, 05 Apr 2005 23:23:14 +0000
parents f3e82dc57c7e
children ca122bc16277
comparison
equal deleted inserted replaced
3259:f3e82dc57c7e 3262:62d58c72621b
1 =================== 1 ===================
2 Customising Roundup 2 Customising Roundup
3 =================== 3 ===================
4 4
5 :Version: $Revision: 1.161.2.11 $ 5 :Version: $Revision: 1.161.2.12 $
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::
4053 4053
4054 # and give the new users access to the web and email interface 4054 # and give the new users access to the web and email interface
4055 db.security.addPermissionToRole('Provisional User', 'Web Access') 4055 db.security.addPermissionToRole('Provisional User', 'Web Access')
4056 db.security.addPermissionToRole('Provisional User', 'Email Access') 4056 db.security.addPermissionToRole('Provisional User', 'Email Access')
4057 4057
4058 # make sure they can view & edit their own user record
4059 def own_record(db, userid, itemid):
4060 '''Determine whether the userid matches the item being accessed.'''
4061 return userid == itemid
4062 p = db.security.addPermission(name='View', klass='user', check=own_record,
4063 description="User is allowed to view their own user details")
4064 db.security.addPermissionToRole('Provisional User', p)
4065 p = db.security.addPermission(name='Edit', klass='user', check=own_record,
4066 description="User is allowed to edit their own user details")
4067 db.security.addPermissionToRole('Provisional User', p)
4058 4068
4059 Then, in ``config.ini``, we change the Role assigned to newly-registered 4069 Then, in ``config.ini``, we change the Role assigned to newly-registered
4060 users, replacing the existing ``'User'`` values:: 4070 users, replacing the existing ``'User'`` values::
4061 4071
4062 [main] 4072 [main]

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