Opened 7 years ago

Closed 13 months ago

# [PATCH] suppress some users from assign-to box, especially current track user and ticket owner

Reported by: Owned by: Patrick Schaaf Morris normal FlexibleAssignToPlugin normal 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

### Changed 7 years ago by Patrick Schaaf

what I patched to get at req

### Changed 7 years ago by Patrick Schaaf

Solving the problem properly - a contribution to FlexibleAssignTo

### comment:1 Changed 7 years ago by Patrick Schaaf

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 7 years ago by Patrick Schaaf

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 7 years ago by Patrick Schaaf

Summary: access to ticket / request data → [PATCH] suppress some users from assign-to box, especially current track user and ticket owner

### comment:4 Changed 13 months ago by Ryan J Ollos

Resolution: → wontfix 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.

### Modify Ticket

Change Properties