comparison doc/upgrading.txt @ 3518:7fb8cfe3c737

enable editing of public queries [SF#966144]
author Richard Jones <richard@users.sourceforge.net>
date Fri, 27 Jan 2006 03:30:39 +0000
parents 4aeb0d0cf0d6
children 61d48244e7a8
comparison
equal deleted inserted replaced
3516:fe75b55fc49d 3518:7fb8cfe3c737
11 0.6.8 though, you'll need to check the "0.5 to 0.6" and "0.6.x to 0.6.3" 11 0.6.8 though, you'll need to check the "0.5 to 0.6" and "0.6.x to 0.6.3"
12 steps. 12 steps.
13 13
14 .. contents:: 14 .. contents::
15 15
16 Migrating from 0.8.x to 0.9.0 16 Migrating from 0.8.x to 1.0
17 ============================= 17 ===========================
18 18
19 No upgrade steps are required. 19 1.0 New Query Permissions
20 -------------------------
21
22 New permissions are defined for query editing and viewing. To include these
23 in your tracker, you need to add these lines to your tracker's
24 ``schema.py``::
25
26 # Users should be able to edit and view their own queries. They should also
27 # be able to view any marked as not private. They should not be able to
28 # edit others' queries, even if they're not private
29 def view_query(db, userid, itemid):
30 private_for = db.query.get(itemid, 'private_for')
31 if not private_for: return True
32 return userid == private_for
33 def edit_query(db, userid, itemid):
34 return userid == db.query.get(itemid, 'creator')
35 p = db.security.addPermission(name='View', klass='query', check=view_query,
36 description="User is allowed to view their own and public queries")
37 db.security.addPermissionToRole('User', p)
38 p = db.security.addPermission(name='Edit', klass='query', check=edit_query,
39 description="User is allowed to edit their queries")
40 db.security.addPermissionToRole('User', p)
41 p = db.security.addPermission(name='Create', klass='query',
42 description="User is allowed to create queries")
43 db.security.addPermissionToRole('User', p)
44
45 and then remove 'query' from the line::
46
47 # Assign the access and edit Permissions for issue, file and message
48 # to regular users now
49 for cl in 'issue', 'file', 'msg', 'query', 'keyword':
50
51 so it looks like::
52
53 for cl in 'issue', 'file', 'msg', 'keyword':
20 54
21 55
22 Migrating from 0.8.0 to 0.8.3 56 Migrating from 0.8.0 to 0.8.3
23 ============================= 57 =============================
24 58

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