diff share/roundup/templates/devel/schema.py @ 4902:a403c29ffaf9

Security fix default user permissions Default user permissions should not include all user attributes. We now limit this to the username, realname and some further attributes depending on the schema. Note that we no longer include the email addresses, depending on your installation you may want to further restrict this or add some attributes like ``address`` and ``alternate_addresses``.
author Ralf Schlatterbeck <rsc@runtux.com>
date Fri, 04 Jul 2014 15:32:28 +0200
parents d3f8d0be588c
children 29bd12331b86
line wrap: on
line diff
--- a/share/roundup/templates/devel/schema.py	Wed Jun 25 13:19:42 2014 +1000
+++ b/share/roundup/templates/devel/schema.py	Fri Jul 04 15:32:28 2014 +0200
@@ -292,8 +292,13 @@
 
 # May users view other user information? Comment these lines out
 # if you don't want them to
-db.security.addPermissionToRole('User', 'View', 'user')
-db.security.addPermissionToRole('Developer', 'View', 'user')
+p = db.security.addPermission(name='View', klass='user', 
+    properties=('id', 'organisation', 'phone', 'realname', 'timezone',
+    'vcs_name', 'username'))
+db.security.addPermissionToRole('User', p)
+db.security.addPermissionToRole('Developer', p)
+
+# Coordinator may also edit users, so they may see everything:
 db.security.addPermissionToRole('Coordinator', 'View', 'user')
 
 # Allow Coordinator to edit any user, including their roles.

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