# Ticket #8911 (new enhancement)

Opened 2 years ago

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

Reported by: Assigned to: bof gt4329b normal FlexibleAssignToPlugin normal 0.11

### Description

(also sent to trac-dev@googlegroups.com, 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

## Change History

### 06/20/11 20:43:59 changed by bof

what I patched to get at req

### 06/21/11 13:38:41 changed by bof

Solving the problem properly - a contribution to FlexibleAssignTo?

### 06/21/11 13:48:19 changed by bof

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]

• 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.

### 06/21/11 15:24:24 changed by bof

FYI: I have just put up my IValidOwnerProvider on trac-hacks:

Maybe you want to provide a cross-link from the FlexibleAssignTo? page.

### 06/24/11 11:45:05 changed by bof

• summary changed from access to ticket / request data to [PATCH] suppress some users from assign-to box, especially current track user and ticket owner.

### Add/Change #8911 ([PATCH] suppress some users from assign-to box, especially current track user and ticket owner)

Change Properties