Mercurial > p > roundup > code
diff doc/upgrading.txt @ 7936:a9b136565838
feat: issue1525113 - notation to filter by logged-in user
At long last (almost 18 years) this patch lands. It allows sharing of
queries that want to use the currently logged in user (i.e. I or me).
By replacing an id number for the user by '@current_user' in the query
you can share the query for "my issues" where 'my' is the logged in
user not the person who created the query.
Updated the templates to use this.
Updated upgrading.py for directions on using it.
RDBMS and anydbm both work. Also expressions using it (e.g. not
@current_user) work and are tested.
Test code done.
I am not sure what the change to templating.py does. I am following
the original patch and have built a test case to hit the if
clause. But the rest of the test doesn't actualy provide the props I
need. If I knew what that code was supposed to do there I would create
a real test.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 06 May 2024 00:49:43 -0400 |
| parents | c05ea62b4c7a |
| children | ce5a554b2f88 |
line wrap: on
line diff
--- a/doc/upgrading.txt Sun May 05 20:57:11 2024 -0400 +++ b/doc/upgrading.txt Mon May 06 00:49:43 2024 -0400 @@ -293,6 +293,43 @@ It is also missing the ``solves`` field which is added to match the schema. +Use @current_user in Searches (optional) +---------------------------------------- + +You can create queries like: "My issues" by searching the ``creator`` +property of issues for your id number. Similarly you can search for +"Issues assigned to me" by searching on the ``assignedto`` property. + +Queries in Roundup can be shared between users. However queries like +these can be shared. However for any user but they will only find +issues created by/assigned to the user who created the query. + +This release allows you to search Links to the User class by +specifying ``@current_user``. This token searches for the currently +log in user. It makes searches like the above usable when shared. + +This only works for properties that are a Link to the user +class. E.G. creator, actor, assignedto. It does not yet work for +MultiLink properties (like nosy). + +As an example this can be deployed to the classic tracker's issue +search template (issue.search.html), by replacing:: + + <option metal:fill-slot="extra_options" i18n:translate="" + tal:attributes="value request/user/id">created by + me</option> + +with:: + + <option metal:fill-slot="extra_options" value="@current_user" + tal:attributes="selected python:value == '@current_user'" + i18n:translate="">created by me</option> + +There are three places where ``value request/user/id`` is used in the +classic template. Your template may have more. +`Details can be found in issue1525113 + <https://issues.roundup-tracker.org/issue1525113>`_. + New PostgreSQL Settings (optional) ----------------------------------
