Roundup Tracker - Issues

Issue 1525113

classification
notation to filter by logged-in user
Type: rfe Severity: normal
Components: Interface Versions:
process
Status: fixed fixed
:
: rouilj : ajaksu2, jonct, richard, rouilj
Priority: normal : patch

Created on 2006-07-19 09:23 by jonct, last changed 2024-05-06 05:27 by rouilj.

Files
File name Uploaded Description Edit Remove
dot-means-current-user.patch jonct, 2006-09-13 10:44
add_dot_as_current_user-2016-06-10-head.diff rouilj, 2016-06-11 01:02
Messages
msg3433 Author: [hidden] (jonct) Date: 2006-07-19 09:23
It would be handy to define a shared query whose filter
arguments automatically specify the currently logged-in
user.

This could be a special case that only works for links
or multilinks targeting the "user" class.

Filtering in those fields by a magic identifier such as
"." would be interpreted to mean the currently
logged-in user.  ("." matches the special "right now"
date syntax.)

Example uses:
  "My Issues" filters on "creator=."
  "My Assignments" filters on "assignedto=."
  "Closed by me" filters on "actor=."

Thus the admin or template designer could define and
document such queries in one place, to work for everyone.
msg3434 Author: [hidden] (jonct) Date: 2006-09-13 10:44
Logged In: YES 
user_id=131905

Patches lookup() in each backend and filter() in
rdbms_common to implement the feature.  (Tested primarily
using sqlite.)

Patches lookupIds() in templating to allow the form values
to pass through where appropriate.

Patches the classic template search form so that "created by
me" and "done by me" generate queries that work for any
value of "me".  :)
msg3616 Author: [hidden] (ajaksu2) Date: 2009-03-01 20:48
I like this idea, but I'm trying to implement it mostly in template: if
'private_for' is -1, append current user ID to the query URL.
msg5554 Author: [hidden] (rouilj) Date: 2016-04-30 03:46
I am planning on applying this patch as it seems it should be useful.

Does anybody have a reason it shouldn't be applied?

I am not sure where this needs to get documented.

user_guide.txt doesn't seem to have a natural place
to put this.

anybody got a suggestion?
msg5586 Author: [hidden] (rouilj) Date: 2016-06-11 01:02
I applied this to the current codebase. I think I got it right (the
patch is almost 10 years old).

Using ./demo.py with the url:

http://localhost:9017/demo/issue?status=-1%2C1%2C2%2C3%2C4%2C5%2C6%2C7&@sort=-activity&@search_text=&@columns=id%2Cactivity%2Ctitle%2Ccreator%2Cstatus&assignedto=.&@group=priority&@dispname=Your%20Issues&@filter=status%2Cassignedto&@pagesize=50&@startwith=0

and logged in as the demo user, I am not getting any issues although
there are two issues owned by demo.

I have attached my patch to the 2016-06-10 roundup trunk/default.

If anybody wants to try to fix this feel free.

Also if anybody can see a place to add this as a test case that would
also be welcome.

I am keeping this open but marking as out-of-date. If somebody has a
better idea of how to mark this feel free.
msg8035 Author: [hidden] (rouilj) Date: 2024-05-06 05:27
I am working on applying this again. I am changing '.' as the magic
token to '@current_user' I think this is more descriptive.

As '@current_user' is not a valid email address (which are sometimes used as usernames)
and regular usernames are unlikely to start with an @ I think this is safe. If there is
a user who is named that, searching for this name will not work for any user except
'@current_user'. In that case, they will have to change their name.

I have this working for Link type, but not multilink.

committed Link search enhancement in:  changeset:   7936:a9b136565838

I'll open a new issue to extend this to MultiLinks. Maybe we can get a fix landed in < 10
years 8-).
History
Date User Action Args
2024-05-06 05:27:37rouiljsetstatus: open -> fixed
resolution: out of date -> fixed
messages: + msg8035
2016-06-11 01:02:34rouiljsetfiles: + add_dot_as_current_user-2016-06-10-head.diff
resolution: out of date
messages: + msg5586
2016-04-30 03:46:17rouiljsetassignee: richard -> rouilj
messages: + msg5554
nosy: + rouilj
2016-04-11 00:51:27rouiljsetkeywords: + patch
2009-03-01 20:48:54ajaksu2setnosy: + ajaksu2
messages: + msg3616
2006-07-19 09:23:03jonctcreate