22Customising Roundup
33===================
44
5- :Version: $Revision: 1.138 $
5+ :Version: $Revision: 1.139 $
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
@@ -2502,13 +2502,6 @@ is also done in the ``open()`` function of ``dbinit.py``.
25022502There are currently two loops which set up permissions and then assign
25032503them to various roles. Simply add the new "category" to both lists::
25042504
2505- # new permissions for this schema
2506- for cl in 'issue', 'file', 'msg', 'user', 'category':
2507- db.security.addPermission(name="Edit", klass=cl,
2508- description="User is allowed to edit "+cl)
2509- db.security.addPermission(name="View", klass=cl,
2510- description="User is allowed to access "+cl)
2511-
25122505 # Assign the access and edit permissions for issue, file and message
25132506 # to regular users now
25142507 for cl in 'issue', 'file', 'msg', 'category':
@@ -2517,24 +2510,8 @@ them to various roles. Simply add the new "category" to both lists::
25172510 p = db.security.getPermission('Edit', cl)
25182511 db.security.addPermissionToRole('User', p)
25192512
2520- So you are in effect doing the following (with 'cl' substituted by its
2521- value)::
2522-
2523- db.security.addPermission(name="Edit", klass='category',
2524- description="User is allowed to edit "+'category')
2525- db.security.addPermission(name="View", klass='category',
2526- description="User is allowed to access "+'category')
2527-
2528- which is creating two permission types; that of editing and viewing
2529- "category" objects respectively. Then the following lines assign those
2530- new permissions to the "User" role, so that normal users can view and
2531- edit "category" objects::
2532-
2533- p = db.security.getPermission('View', 'category')
2534- db.security.addPermissionToRole('User', p)
2535-
2536- p = db.security.getPermission('Edit', 'category')
2537- db.security.addPermissionToRole('User', p)
2513+ These lines assign the View and Edit Permissions to the "User" role, so
2514+ that normal users can view and edit "category" objects.
25382515
25392516This is all the work that needs to be done for the database. It will
25402517store categories, and let users view and edit them. Now on to the
0 commit comments