Project

General

Profile

Actions

Feature #8313

open

Restrict Assignee List by Role

Added by Andrew Parnell almost 13 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues workflow
Target version:
-
Start date:
2011-05-06
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Currently the assignee list shows every member of a project. This means that anyone in the project can assign a ticket to anyone else in the project. It would be great if there was a way to restrict the possible assignees depending on your role and the roles of the possible assignees.

For example: We have Managers, Developers, and Reports working together on a project. The Managers should be able to assign tickets to anyone of all three roles. The Developers should be able to assign tickets to Managers or other Developers. The Reporters should only be able to assign tickets to Managers.

The primary function of this will be so that those project members who are of the Reporter role are not able to open a ticket and assign it straight to a developer.


Related issues

Related to Redmine - Feature #8050: Mightful workflow field enhancement: visible, read only and mandatory Closed2011-04-03

Actions
Related to Redmine - Feature #12005: Mightful workflow field enhancement: hideNew

Actions
Related to Redmine - Feature #2937: Filter assignable users based on workflowNew2009-03-09

Actions
Related to Redmine - Patch #212: Assign To limited by workflowNew

Actions
Actions #1

Updated by Terence Mill almost 13 years ago

This is a subset of the featured i proposed here: "Mightful workflow field enhancement: visible, read only and mandatory" #8050

Actions #2

Updated by Terence Mill almost 13 years ago

I fact your proposal makes filter on value of field based on user's role not only the complete field visbility (visble, redonly, mandatory) as described in #8050. So your feature request is an ehancement of #8050 - shal be set related each other.

Actions #3

Updated by Daniel Felix about 11 years ago

I set the relations to #8050 and #12005 (which follows #8050).

This would be a nice idea. But I think this could be really complicated to manage, or?

What do you thing about role restriction?
A user just can reassign a ticket to another user, which holds a role he's allowed to use.

Example:
User A is in role developer. Role developer only allows to assign tickets to reporters and to other users with the role developers.
User B is in role senior developer. He is allowed to assign tickets to users, developers, senior developers and managers.

What do you think about this proposal?

Actions #4

Updated by Ramesh S about 11 years ago

What do you thing about role restriction?
A user just can reassign a ticket to another user, which holds a role he's allowed to use.

+1
I think this is a great idea, and it will help restrict who can assign an issue to who, based on the roles. And in the use case where we are trying to setup one redmine project per customer with 'customer', 'manager' and 'developer' all having access to this redmine project, a feature like this will help in restricting who can assign issue to who as it is very important as we don't want customer to directly assign issue to developer.

I can help test this feature if a patch is available.

Actions #5

Updated by Rupesh Helwade over 10 years ago

+1

Actions #6

Updated by Daniele Pedroni about 10 years ago

I agree, it would be quite necessary at least to limit the assignee list to some roles (and by project).
Then, the capability to allow/deny issue assignment based on roles could be a good enhancement, but a bit less important, IMHO.

This would speedup the search: large teams will lead to impressive lists of possible assignees, not that comfortable to manage...

Actions #7

Updated by Jethro Yu about 10 years ago

+1. In our process RD (role) can only assign a changing-to-verification issue to QA (role), but some RD will assign verification to PM (role), which is not expected.

Actions #8

Updated by Thomas Tingey almost 10 years ago

+1 This would be super useful. We want to be able for our sales team to only assign tickets to managers who then can assign them to developers.

Actions #9

Updated by Paul Chu about 9 years ago

+1.
Any update?
This feature seems related to #2937 (Filter assignable users based on workflow)
It would be very helpful if the assignee list is changed corresponding to issue status.
We are waiting for such feature implemented.

Actions #10

Updated by Toshi MARUYAMA about 9 years ago

  • Related to Feature #2937: Filter assignable users based on workflow added
Actions #11

Updated by Luis Roa almost 8 years ago

Hi. I created a new plugin to filter assignable users based on workflow.

https://github.com/luisr9/redmine_filter_assignable

I'm newbie in ruby, but I believe and I hope this work for you too, sorry for my english.

Actions #12

Updated by Beslan CELIKCAN almost 8 years ago

Hi Luis,

How can i use this plugin. Redmine says installed but nothing changed in workflow page.

Actions #13

Updated by Luis Roa almost 8 years ago

Hi, Beslan CELIKCAN.

You can find change in edit issue page, when you select a assignable user, you don't see all user list, you only see the users who can change the next status.

For example:
Your project has these roles: "client", "manager" and "programmers" and your workflow is:

Client creates issues with new status.
Manager can change status from new to assigned.
Programmers can change from assigned to resolved.
Client can change status from resolved to closed.

When manager changes status to "assigned", in the dropdownlist assignee_to only members with programmers role are available, because in your workflow only programmers can change from "assigned" status to other status.

I hope you understand, sorry for my terrible english. :|

Actions #14

Updated by Beslan CELIKCAN almost 8 years ago

Thanks Luis. I,ll try.

Luis Roa wrote:

Hi, Beslan CELIKCAN.

You can find change in edit issue page, when you select a assignable user, you don't see all user list, you only see the users who can change the next status.

For example:
Your project has these roles: "client", "manager" and "programmers" and your workflow is:

Client creates issues with new status.
Manager can change status from new to assigned.
Programmers can change from assigned to resolved.
Client can change status from resolved to closed.

When manager changes status to "assigned", in the dropdownlist assignee_to only members with programmers role are available, because in your workflow only programmers can change from "assigned" status to other status.

I hope you understand, sorry for my terrible english. :|

Actions #15

Updated by prathamesh r almost 8 years ago

Thanks Luis, I tried the plugin & found to be working with the latest Redmine installation (Bitnami).

I also want to try few things like restrict individual users from assinee & keep only the groups in assign user etc.

I am very new to redmine & ruby both. I dont want to go into very details but want to write the codes you have written. Can you please let me know reference you have taken using which you have written this code. currently i am not getting the reference material from net using which i can write such code.

Please confirm is the following code only is filtering the assignees ? or there is more code in the plugin you have provided.


require_dependency 'issue'

class Issue

  def assignable_users_with_filter_assignable
    users = project.assignable_users.where("role_id IN (?)",
    WorkflowTransition.where(:tracker_id => tracker_id, :old_status_id => status_id).select(:role_id).distinct.map { |e| e.role_id }
    ).to_a
    users << author if author && author.active?
    users << assigned_to if assigned_to
    users.uniq.sort
  end

  alias_method_chain :assignable_users, :filter_assignable
end

Actions #16

Updated by Luis Roa almost 8 years ago

Hello prathamesh r,

Exactly, these code does the work.

I was searching the text "assign" in redmine's source code, and I found this method, this patch #212 was helpfull for write the plugin too.

I think that is possible keep only the groups in assign user, I want to modify the plugin for to choose what type of user. "users", "groups", "both", I will research how complete this task.

workaround:

def assignable_users_with_filter_assignable
    types = ['Group']    
    users = project.assignable_users.where(:type=>types).where("role_id IN (?)",
    WorkflowTransition.where(:tracker_id => tracker_id, :old_status_id => status_id).select(:role_id).distinct.map { |e| e.role_id }
    ).to_a
    users << author if author && author.active?
    users << assigned_to if assigned_to
    users.uniq.sort
end
Actions #17

Updated by prathamesh r almost 8 years ago

Thanks Luis, it worked as expected :). Thanks for support.

I was searching the type of user part like is it "users", "groups", "both", however i was not able to get these details.

Is going through existing redmine source code is only solution for creation of plugins ? there is noting like documentation where it is mentioned that type of users are of 3 category etc...

Actions #18

Updated by Luis Roa almost 8 years ago

Hi guys, Lo prometido es deuda

I modified the plugin, now you can choose kind of users to show in assign.

In plugin's settings you can find 3 options: show users, show groups and show author.

If you can't see the group, you could enable "Allow issue assignment to groups" in Issue traking tab of application's settings.

P.d: Prathamesh, you can uncheck "show users" and "show author" and this plugins works for you.

url plugin: https://github.com/luisr9/redmine_filter_assignable

Actions #19

Updated by Toshi MARUYAMA almost 8 years ago

  • Related to Patch #212: Assign To limited by workflow added
Actions #20

Updated by ale dp over 7 years ago

Luis Roa wrote:

Hi guys, Lo prometido es deuda

I modified the plugin, now you can choose kind of users to show in assign.

In plugin's settings you can find 3 options: show users, show groups and show author.

If you can't see the group, you could enable "Allow issue assignment to groups" in Issue traking tab of application's settings.

P.d: Prathamesh, you can uncheck "show users" and "show author" and this plugins works for you.

url plugin: https://github.com/luisr9/redmine_filter_assignable

Hello Luis , works for any version of Redmine ? I use version 2.5. Thanks

Actions #21

Updated by Luis Roa over 7 years ago

ale dp wrote:

Luis Roa wrote:

Hi guys, Lo prometido es deuda

I modified the plugin, now you can choose kind of users to show in assign.

In plugin's settings you can find 3 options: show users, show groups and show author.

If you can't see the group, you could enable "Allow issue assignment to groups" in Issue traking tab of application's settings.

P.d: Prathamesh, you can uncheck "show users" and "show author" and this plugins works for you.

url plugin: https://github.com/luisr9/redmine_filter_assignable

Hello Luis , works for any version of Redmine ? I use version 2.5. Thanks

Hi Alejandra, I use version 3.1.2 and plugin works fine.

I think that this plugin would work on any version that have a "assignable_users" action in IssueController.

If you try the plugin and doesn't work, We could work together for find a solution, you can write a email to

Sorry for my bad english, I think that you speak spanish like me.

Actions #22

Updated by Geowolf Yeh almost 7 years ago

Luis Roa wrote:

For example:
Your project has these roles: "client", "manager" and "programmers" and your workflow is:

Client creates issues with new status.
Manager can change status from new to assigned.
Programmers can change from assigned to resolved.
Client can change status from resolved to closed.

When manager changes status to "assigned", in the dropdownlist assignee_to only members with programmers role are available, because in your workflow only programmers can change from "assigned" status to other status.

I hope you understand, sorry for my terrible english. :|

Hi, Luis:
Firstly, in order to filter assignee list with roles, I almost find all of Plugin Directory and yours are the more practical to use.

But my organization roles are more complex than these example.

For example:
We have the same roles with you.
Usually, my role often different with next progress role in the Workflow.
But some of our members can own the two roles at least.
If I'm "CLIENT", and both play the role of "PROGRAMMERS", I can assign to "CLIENT" and "PROGRAMMERS" in the assignee_to list.
My solution is add filter that the same role with issue editor can not appear in the assignee_to list.

So I try to add condition

where.not(:role_id => roles.map(&:id))

into IssueController_patch.rb below:

        users = project.assignable_users.where(:type => types).where.not(:role_id => roles.map(&:id)).where("role_id IN (?)",
            WorkflowTransition.where(:tracker_id => tracker_id, :old_status_id => status_id).select(:role_id).distinct.map { |e| e.role_id }
            ).to_a

But after migrate and restart Redmine, it doesn't work.
So how can I add the condition of filer the same role with issue editor in the assignee_to list?

I'm not first language in Eng. and hope you can recognize my terrible writting, too. HA!HA!:)

Actions #23

Updated by Luis Roa almost 7 years ago

Hi Geowolf Yeh,

If I understood your problem, you want to hide the assignable users that share the same role of the current user.

Can you tell me if it is?

replace this:

users = project.assignable_users.where(:type => types).where.not(:role_id => roles.map(&:id)).where("role_id IN (?)",
            WorkflowTransition.where(:tracker_id => tracker_id, :old_status_id => status_id).select(:role_id).distinct.map { |e| e.role_id }
            ).to_a

for this:

users = project.assignable_users.where(:type => types)        
        .where("role_id NOT IN (?)",User.current.roles_for_project(project).select(:role_id).distinct.map { |e| e.role_id })
        .where("role_id IN (?)",
        WorkflowTransition.where(:tracker_id => tracker_id, :old_status_id => status_id).select(:role_id).distinct.map { |e| e.role_id }
        ).to_a
Actions

Also available in: Atom PDF