Mercurial > p > roundup > code
comparison templates/classic/dbinit.py @ 2076:2a4309450202
security fixes and doc updates
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 12 Mar 2004 05:36:26 +0000 |
| parents | eb043e7d0899 |
| children | 3e0961d6d44d |
comparison
equal
deleted
inserted
replaced
| 2075:b1704ba7be41 | 2076:2a4309450202 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: dbinit.py,v 1.3 2004-01-19 23:57:47 richard Exp $ | 18 # $Id: dbinit.py,v 1.4 2004-03-12 05:36:26 richard Exp $ |
| 19 | 19 |
| 20 import os | 20 import os |
| 21 | 21 |
| 22 import config | 22 import config |
| 23 from select_db import Database, Class, FileClass, IssueClass | 23 from select_db import Database, Class, FileClass, IssueClass |
| 96 # | 96 # |
| 97 # SECURITY SETTINGS | 97 # SECURITY SETTINGS |
| 98 # | 98 # |
| 99 # See the configuration and customisation document for information | 99 # See the configuration and customisation document for information |
| 100 # about security setup. | 100 # about security setup. |
| 101 # Add new Permissions for this schema | |
| 102 for cl in 'issue', 'file', 'msg', 'user', 'query', 'keyword': | |
| 103 db.security.addPermission(name="Edit", klass=cl, | |
| 104 description="User is allowed to edit "+cl) | |
| 105 db.security.addPermission(name="View", klass=cl, | |
| 106 description="User is allowed to access "+cl) | |
| 107 | |
| 108 # Assign the access and edit Permissions for issue, file and message | 101 # Assign the access and edit Permissions for issue, file and message |
| 109 # to regular users now | 102 # to regular users now |
| 110 for cl in 'issue', 'file', 'msg', 'query', 'keyword': | 103 for cl in 'issue', 'file', 'msg', 'query', 'keyword': |
| 111 p = db.security.getPermission('View', cl) | 104 p = db.security.getPermission('View', cl) |
| 112 db.security.addPermissionToRole('User', p) | 105 db.security.addPermissionToRole('User', p) |
| 113 p = db.security.getPermission('Edit', cl) | 106 p = db.security.getPermission('Edit', cl) |
| 114 db.security.addPermissionToRole('User', p) | 107 db.security.addPermissionToRole('User', p) |
| 108 for cl in 'priority', 'status': | |
| 109 p = db.security.getPermission('View', cl) | |
| 115 | 110 |
| 116 # and give the regular users access to the web and email interface | 111 # and give the regular users access to the web and email interface |
| 117 p = db.security.getPermission('Web Access') | 112 p = db.security.getPermission('Web Access') |
| 118 db.security.addPermissionToRole('User', p) | 113 db.security.addPermissionToRole('User', p) |
| 119 p = db.security.getPermission('Email Access') | 114 p = db.security.getPermission('Email Access') |
