Skip to content

Commit 8f2859c

Browse files
committed
issue2550831: Make the classic template query.edit page work.
Forgot to update the classic schema.py with the Restore permissions for the query class for the User role. Also forgot to document same in upgrading.txt.
1 parent 7959ecb commit 8f2859c

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

doc/upgrading.txt

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,21 @@ Improvements in Classic Tracker query.edit.html template
174174
--------------------------------------------------------
175175

176176
There is a new query editing template included in the distribution at:
177-
share/roundup/templates/classic/html/query.edit.html
177+
178+
``share/roundup/templates/classic/html/query.edit.html``
178179

179180
This template fixes:
180181

181-
* Once added, a public query could not be removed from "Your Queries". Trying to do so would cause a permissions error.
182-
* The private yes/no dropdown always showed "yes" regardless of underlying state
183-
* The query Delete button did not work.
184-
* The same query being displayed multiple times
182+
* public query could not be removed from "Your Queries" once it was added.
183+
Trying to do so would cause a permissions error.
184+
* private yes/no dropdown always showed "yes" regardless of
185+
underlying state
186+
* query Delete button did not work.
187+
* same query being displayed multiple times
185188

186189
It also adds:
187-
* the table layout displays queries created by the user first, then available public queries.
190+
* the table layout displays queries created by the user first,
191+
then available public queries.
188192
* public query owners are shown
189193
* better support for deleted queries. When a query is deleted, it is
190194
still available for those who added it to their query list. If you
@@ -197,9 +201,25 @@ It also adds:
197201
* notifies the user that delete/restore requires javascript. It
198202
always did, but that requirement wasn't displayed.
199203

200-
If you have not modified the query.edit.html template in your tracker, you should be
201-
able to copy the new version from the location above. Otherwise you will
202-
have to merge the changes into your modified template.
204+
To use the new template, you must add Restore permission on queries to
205+
allow the user to restore queries (see below).
206+
207+
If you have not modified the query.edit.html template in your tracker,
208+
you should be able to copy the new version from the location above.
209+
Otherwise you will have to merge the changes into your modified template.
210+
211+
You will need to add the query Restore permission for the User role to
212+
your tracker's schema.py file. Place it right after the query retire
213+
permission for the user role. After the change it should look like::
214+
215+
p = db.security.addPermission(name='Retire', klass='query', check=edit_query,
216+
description="User is allowed to retire their queries")
217+
db.security.addPermissionToRole('User', p)
218+
p = db.security.addPermission(name='Restore', klass='query', check=edit_query,
219+
description="User is allowed to restore their queries")
220+
db.security.addPermissionToRole('User', p)
221+
222+
where the last three lines are the ones you need to add.
203223

204224
Migrating from 1.5.0 to 1.5.1
205225
=============================

share/roundup/templates/classic/schema.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ def edit_query(db, userid, itemid):
140140
p = db.security.addPermission(name='Retire', klass='query', check=edit_query,
141141
description="User is allowed to retire their queries")
142142
db.security.addPermissionToRole('User', p)
143+
p = db.security.addPermission(name='Restore', klass='query', check=edit_query,
144+
description="User is allowed to restore their queries")
145+
db.security.addPermissionToRole('User', p)
143146
p = db.security.addPermission(name='Create', klass='query',
144147
description="User is allowed to create queries")
145148
db.security.addPermissionToRole('User', p)

0 commit comments

Comments
 (0)