Opened 13 years ago
Closed 8 years ago
#8911 closed enhancement (wontfix)
[PATCH] suppress some users from assign-to box, especially current track user and ticket owner
Reported by: | Patrick Schaaf | Owned by: | Morris |
---|---|---|---|
Priority: | normal | Component: | FlexibleAssignToPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
(also sent to trac-dev@…, but I don't know whether that goes through)
for a plugin I'm working on, which is designed to provide the IValidOwnerProvider interface, I need access to req.authname, and ideally also to ticket.owner for the ticket under consideration.
I need this for an optional feature of removing / forbidding the current user (or ticket owner) as a next-step assignee in a workflow.
I managed to get at req.authname, but only by modifying FlexibleAssignTo itself to pass down the req parameter to the getUsers method.
And I did not "immediately" find a way to get at the ticket information itself, so I'm still missing the desired forbid-current-ticket-owner functionality.
Is there some generic way I missed, to get at both pieces of information from that place? Some self.env magic?
best regards
Patrick
Attachments (2)
Change History (6)
Changed 13 years ago by
Attachment: | flexible-req.patch added |
---|
Changed 13 years ago by
Attachment: | flexible-suppress.patch added |
---|
Solving the problem properly - a contribution to FlexibleAssignTo
comment:1 Changed 13 years ago by
After sleeping over it for a night, I realized that the proper solution to my problem would be a different modification to FlexibleAssignTo.
My second patch, flexible-suppress.patch, could IMHO be applied. It provides a generic way to suppress a list of users from the assign-to box, after and independant of the IValidOwnerProviders.
- in section
[flexibleassignto]
a new variable suppress can be set to a list of usernames that should ALWAYS be suppressed:[flexibleassignto] suppress = admin, anonymous
- in each workflow step, a new variable .flexibleassignto_suppress can be
set in a similar fashion, giving additional users to suppress for that step only:
[ticket-workflow] ... mystep.flexibleassignto_suppress = somefreak, $OWNER
- in these suppression lists,
$USER
can be used to refer to the currently authenticated user (req.authname) - also,
$OWNER
can be used to refer to the current ticket owner, if any.
I have tested the patch on trac 0.11, but it applies also to the 0.13 subdirectory. Lacking a 0.13 install, I _hope_ I have the different DB syntax right, but did not test that.
comment:2 Changed 13 years ago by
FYI: I have just put up my IValidOwnerProvider on trac-hacks:
Maybe you want to provide a cross-link from the FlexibleAssignTo page.
comment:3 Changed 13 years ago by
Summary: | access to ticket / request data → [PATCH] suppress some users from assign-to box, especially current track user and ticket owner |
---|
comment:4 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The plugin is deprecated in Trac 1.3.2 and later. To customize the list of users that appear in the assign-to list, subclass ConfigurableTicketWorkflow
and override the get_allowed_owners
method.
what I patched to get at req