https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292011-05-07T14:25:18ZRedmineRedmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=287232011-05-07T14:25:18ZTerence Mill
<ul></ul><p>This is a subset of the featured i proposed here: "Mightful workflow field enhancement: visible, read only and mandatory" <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Mightful workflow field enhancement: visible, read only and mandatory (Closed)" href="https://www.redmine.org/issues/8050">#8050</a></p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=287242011-05-07T14:29:32ZTerence Mill
<ul></ul><p>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 <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Mightful workflow field enhancement: visible, read only and mandatory (Closed)" href="https://www.redmine.org/issues/8050">#8050</a>. So your feature request is an ehancement of <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Mightful workflow field enhancement: visible, read only and mandatory (Closed)" href="https://www.redmine.org/issues/8050">#8050</a> - shal be set related each other.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=441242013-01-12T17:14:46ZDaniel Felix
<ul></ul><p>I set the relations to <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Mightful workflow field enhancement: visible, read only and mandatory (Closed)" href="https://www.redmine.org/issues/8050">#8050</a> and <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: Mightful workflow field enhancement: hide (New)" href="https://www.redmine.org/issues/12005">#12005</a> (which follows <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Mightful workflow field enhancement: visible, read only and mandatory (Closed)" href="https://www.redmine.org/issues/8050">#8050</a>).</p>
<p>This would be a nice idea. But I think this could be really complicated to manage, or?</p>
<p>What do you thing about role restriction?<br />A user just can reassign a ticket to another user, which holds a role he's allowed to use.</p>
<p>Example:<br />User A is in role developer. Role developer only allows to assign tickets to reporters and to other users with the role developers. <br />User B is in role senior developer. He is allowed to assign tickets to users, developers, senior developers and managers.</p>
<p>What do you think about this proposal?</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=446922013-01-19T13:04:30ZRamesh S
<ul></ul><blockquote>
<p>What do you thing about role restriction?<br />A user just can reassign a ticket to another user, which holds a role he's allowed to use.</p>
</blockquote>
<p>+1<br />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.</p>
<p>I can help test this feature if a patch is available.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=538792013-12-17T10:06:00ZRupesh Helwade
<ul></ul><p>+1</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=544622014-01-23T17:31:49ZDaniele Pedroni
<ul></ul><p>I agree, it would be quite necessary at least to limit the assignee list to some roles (and by project).<br />Then, the capability to allow/deny issue assignment based on roles could be a good enhancement, but a bit less important, IMHO.</p>
<p>This would speedup the search: large teams will lead to impressive lists of possible assignees, not that comfortable to manage...</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=544712014-01-24T07:49:08ZJethro Yu
<ul></ul><p>+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.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=564592014-05-23T20:33:01ZThomas Tingey
<ul></ul><p>+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.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=614452015-02-12T05:05:21ZPaul Chu
<ul></ul><p>+1.<br />Any update?<br />This feature seems related to <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: Filter assignable users based on workflow (New)" href="https://www.redmine.org/issues/2937">#2937</a> (Filter assignable users based on workflow)<br />It would be very helpful if the assignee list is changed corresponding to issue status.<br />We are waiting for such feature implemented.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=622092015-03-13T04:52:11ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/2937">Feature #2937</a>: Filter assignable users based on workflow</i> added</li></ul> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=700572016-03-31T00:04:03ZLuis Roa
<ul></ul><p>Hi. I created a new plugin to filter assignable users based on workflow.</p>
<p><a class="external" href="https://github.com/luisr9/redmine_filter_assignable">https://github.com/luisr9/redmine_filter_assignable</a></p>
<p>I'm newbie in ruby, but I believe and I hope this work for you too, sorry for my english.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=709762016-05-16T15:48:54ZBeslan CELIKCAN
<ul></ul><p>Hi Luis,</p>
<p>How can i use this plugin. Redmine says installed but nothing changed in workflow page.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=709772016-05-16T16:57:24ZLuis Roa
<ul></ul><p>Hi, Beslan CELIKCAN.</p>
<p>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.</p>
<p>For example:<br />Your project has these roles: "client", "manager" and "programmers" and your workflow is:</p>
<p>Client creates issues with new status.<br />Manager can change status from new to assigned.<br />Programmers can change from assigned to resolved.<br />Client can change status from resolved to closed.</p>
<p>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.</p>
<p>I hope you understand, sorry for my terrible english. :|</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=710702016-05-22T08:57:41ZBeslan CELIKCAN
<ul></ul><p>Thanks Luis. I,ll try.</p>
<p>Luis Roa wrote:</p>
<blockquote>
<p>Hi, Beslan CELIKCAN.</p>
<p>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.</p>
<p>For example:<br />Your project has these roles: "client", "manager" and "programmers" and your workflow is:</p>
<p>Client creates issues with new status.<br />Manager can change status from new to assigned.<br />Programmers can change from assigned to resolved.<br />Client can change status from resolved to closed.</p>
<p>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.</p>
<p>I hope you understand, sorry for my terrible english. :|</p>
</blockquote> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=710722016-05-22T17:50:04Zprathamesh r
<ul></ul><p>Thanks Luis, I tried the plugin & found to be working with the latest Redmine installation (Bitnami).</p>
<p>I also want to try few things like restrict individual users from assinee & keep only the groups in assign user etc.</p>
<p>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.</p>
<p>Please confirm is the following code only is filtering the assignees ? or there is more code in the plugin you have provided.</p>
<pre><code class="ruby syntaxhl">
<span class="n">require_dependency</span> <span class="s1">'issue'</span>
<span class="k">class</span> <span class="nc">Issue</span>
<span class="k">def</span> <span class="nf">assignable_users_with_filter_assignable</span>
<span class="n">users</span> <span class="o">=</span> <span class="n">project</span><span class="p">.</span><span class="nf">assignable_users</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="s2">"role_id IN (?)"</span><span class="p">,</span>
<span class="no">WorkflowTransition</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:tracker_id</span> <span class="o">=></span> <span class="n">tracker_id</span><span class="p">,</span> <span class="ss">:old_status_id</span> <span class="o">=></span> <span class="n">status_id</span><span class="p">).</span><span class="nf">select</span><span class="p">(</span><span class="ss">:role_id</span><span class="p">).</span><span class="nf">distinct</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">e</span><span class="o">|</span> <span class="n">e</span><span class="p">.</span><span class="nf">role_id</span> <span class="p">}</span>
<span class="p">).</span><span class="nf">to_a</span>
<span class="n">users</span> <span class="o"><<</span> <span class="n">author</span> <span class="k">if</span> <span class="n">author</span> <span class="o">&&</span> <span class="n">author</span><span class="p">.</span><span class="nf">active?</span>
<span class="n">users</span> <span class="o"><<</span> <span class="n">assigned_to</span> <span class="k">if</span> <span class="n">assigned_to</span>
<span class="n">users</span><span class="p">.</span><span class="nf">uniq</span><span class="p">.</span><span class="nf">sort</span>
<span class="k">end</span>
<span class="n">alias_method_chain</span> <span class="ss">:assignable_users</span><span class="p">,</span> <span class="ss">:filter_assignable</span>
<span class="k">end</span>
</code></pre> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=710762016-05-23T16:40:59ZLuis Roa
<ul></ul><p>Hello prathamesh r,</p>
<p>Exactly, these code does the work.</p>
<p>I was searching the text "assign" in redmine's source code, and I found this method, this patch <a class="issue tracker-3 status-1 priority-4 priority-default" title="Patch: Assign To limited by workflow (New)" href="https://www.redmine.org/issues/212">#212</a> was helpfull for write the plugin too.</p>
<p>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.</p>
<p>workaround:</p>
<pre><code class="ruby syntaxhl"><span class="k">def</span> <span class="nf">assignable_users_with_filter_assignable</span>
<span class="n">types</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'Group'</span><span class="p">]</span>
<span class="n">users</span> <span class="o">=</span> <span class="n">project</span><span class="p">.</span><span class="nf">assignable_users</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:type</span><span class="o">=></span><span class="n">types</span><span class="p">).</span><span class="nf">where</span><span class="p">(</span><span class="s2">"role_id IN (?)"</span><span class="p">,</span>
<span class="no">WorkflowTransition</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:tracker_id</span> <span class="o">=></span> <span class="n">tracker_id</span><span class="p">,</span> <span class="ss">:old_status_id</span> <span class="o">=></span> <span class="n">status_id</span><span class="p">).</span><span class="nf">select</span><span class="p">(</span><span class="ss">:role_id</span><span class="p">).</span><span class="nf">distinct</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">e</span><span class="o">|</span> <span class="n">e</span><span class="p">.</span><span class="nf">role_id</span> <span class="p">}</span>
<span class="p">).</span><span class="nf">to_a</span>
<span class="n">users</span> <span class="o"><<</span> <span class="n">author</span> <span class="k">if</span> <span class="n">author</span> <span class="o">&&</span> <span class="n">author</span><span class="p">.</span><span class="nf">active?</span>
<span class="n">users</span> <span class="o"><<</span> <span class="n">assigned_to</span> <span class="k">if</span> <span class="n">assigned_to</span>
<span class="n">users</span><span class="p">.</span><span class="nf">uniq</span><span class="p">.</span><span class="nf">sort</span>
<span class="k">end</span>
</code></pre> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=710862016-05-24T19:17:31Zprathamesh r
<ul></ul><p>Thanks Luis, it worked as expected :). Thanks for support.</p>
<p>I was searching the type of user part like is it "users", "groups", "both", however i was not able to get these details.</p>
<p>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...</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=710882016-05-24T21:30:01ZLuis Roa
<ul></ul><p>Hi guys, Lo prometido es deuda</p>
<p>I modified the plugin, now you can choose kind of users to show in assign.</p>
<p>In plugin's settings you can find 3 options: show users, show groups and show author.</p>
<p>If you can't see the group, you could enable "Allow issue assignment to groups" in Issue traking tab of application's settings.</p>
<p>P.d: Prathamesh, you can uncheck "show users" and "show author" and this plugins works for you.</p>
<p>url plugin: <a class="external" href="https://github.com/luisr9/redmine_filter_assignable">https://github.com/luisr9/redmine_filter_assignable</a></p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=715272016-06-14T04:44:12ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-1 priority-4 priority-default" href="/issues/212">Patch #212</a>: Assign To limited by workflow</i> added</li></ul> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=735822016-09-15T19:54:53Zale dp
<ul></ul><p>Luis Roa wrote:</p>
<blockquote>
<p>Hi guys, Lo prometido es deuda</p>
<p>I modified the plugin, now you can choose kind of users to show in assign.</p>
<p>In plugin's settings you can find 3 options: show users, show groups and show author.</p>
<p>If you can't see the group, you could enable "Allow issue assignment to groups" in Issue traking tab of application's settings.</p>
<p>P.d: Prathamesh, you can uncheck "show users" and "show author" and this plugins works for you.</p>
<p>url plugin: <a class="external" href="https://github.com/luisr9/redmine_filter_assignable">https://github.com/luisr9/redmine_filter_assignable</a></p>
</blockquote>
<p>Hello Luis , works for any version of Redmine ? I use version 2.5. Thanks</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=736322016-09-19T23:09:29ZLuis Roa
<ul></ul><p>ale dp wrote:</p>
<blockquote>
<p>Luis Roa wrote:</p>
<blockquote>
<p>Hi guys, Lo prometido es deuda</p>
<p>I modified the plugin, now you can choose kind of users to show in assign.</p>
<p>In plugin's settings you can find 3 options: show users, show groups and show author.</p>
<p>If you can't see the group, you could enable "Allow issue assignment to groups" in Issue traking tab of application's settings.</p>
<p>P.d: Prathamesh, you can uncheck "show users" and "show author" and this plugins works for you.</p>
<p>url plugin: <a class="external" href="https://github.com/luisr9/redmine_filter_assignable">https://github.com/luisr9/redmine_filter_assignable</a></p>
</blockquote>
<p>Hello Luis , works for any version of Redmine ? I use version 2.5. Thanks</p>
</blockquote>
<p>Hi Alejandra, I use version 3.1.2 and plugin works fine.</p>
<p>I think that this plugin would work on any version that have a "assignable_users" action in IssueController.</p>
<p>If you try the plugin and doesn't work, We could work together for find a solution, you can write a email to <a class="email" href="mailto:luis.roa9@gmail.com">luis.roa9@gmail.com</a></p>
<p>Sorry for my bad english, I think that you speak spanish like me.</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=777622017-04-05T10:40:59ZGeowolf Yeh
<ul></ul><p>Luis Roa wrote:</p>
<blockquote>
<p>For example:<br />Your project has these roles: "client", "manager" and "programmers" and your workflow is:</p>
<p>Client creates issues with new status.<br />Manager can change status from new to assigned.<br />Programmers can change from assigned to resolved.<br />Client can change status from resolved to closed.</p>
<p>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.</p>
<p>I hope you understand, sorry for my terrible english. :|</p>
</blockquote>
<p>Hi, Luis:<br />Firstly, in order to filter assignee list with roles, I almost find all of Plugin Directory and yours are the more practical to use.</p>
<p>But my organization roles are more complex than these example.</p>
<p>For example:<br />We have the same roles with you. <br />Usually, my role often different with next progress role in the Workflow.<br />But some of our members can own the two roles at least.<br />If I'm "CLIENT", and both play the role of "PROGRAMMERS", I can assign to "CLIENT" and "PROGRAMMERS" in the assignee_to list. <br />My solution is add filter that the same role with issue editor can not appear in the assignee_to list.</p>
<p>So I try to add condition<br /><pre><code class="ruby syntaxhl"><span class="n">where</span><span class="p">.</span><span class="nf">not</span><span class="p">(</span><span class="ss">:role_id</span> <span class="o">=></span> <span class="n">roles</span><span class="p">.</span><span class="nf">map</span><span class="p">(</span><span class="o">&</span><span class="ss">:id</span><span class="p">))</span>
</code></pre></p>
<p>into IssueController_patch.rb below:<br /><pre><code class="ruby syntaxhl"> <span class="n">users</span> <span class="o">=</span> <span class="n">project</span><span class="p">.</span><span class="nf">assignable_users</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:type</span> <span class="o">=></span> <span class="n">types</span><span class="p">).</span><span class="nf">where</span><span class="p">.</span><span class="nf">not</span><span class="p">(</span><span class="ss">:role_id</span> <span class="o">=></span> <span class="n">roles</span><span class="p">.</span><span class="nf">map</span><span class="p">(</span><span class="o">&</span><span class="ss">:id</span><span class="p">)).</span><span class="nf">where</span><span class="p">(</span><span class="s2">"role_id IN (?)"</span><span class="p">,</span>
<span class="no">WorkflowTransition</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:tracker_id</span> <span class="o">=></span> <span class="n">tracker_id</span><span class="p">,</span> <span class="ss">:old_status_id</span> <span class="o">=></span> <span class="n">status_id</span><span class="p">).</span><span class="nf">select</span><span class="p">(</span><span class="ss">:role_id</span><span class="p">).</span><span class="nf">distinct</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">e</span><span class="o">|</span> <span class="n">e</span><span class="p">.</span><span class="nf">role_id</span> <span class="p">}</span>
<span class="p">).</span><span class="nf">to_a</span>
</code></pre></p>
<p>But after migrate and restart Redmine, it doesn't work.<br />So how can I add the condition of filer the same role with issue editor in the assignee_to list?</p>
<p>I'm not first language in Eng. and hope you can recognize my terrible writting, too. HA!HA!:)</p> Redmine - Feature #8313: Restrict Assignee List by Rolehttps://www.redmine.org/issues/8313?journal_id=777822017-04-05T15:10:45ZLuis Roa
<ul></ul><p>Hi Geowolf Yeh,</p>
<p>If I understood your problem, you want to hide the assignable users that share the same role of the current user.</p>
<p>Can you tell me if it is?</p>
<p>replace this:</p>
<pre><code class="ruby syntaxhl"><span class="n">users</span> <span class="o">=</span> <span class="n">project</span><span class="p">.</span><span class="nf">assignable_users</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:type</span> <span class="o">=></span> <span class="n">types</span><span class="p">).</span><span class="nf">where</span><span class="p">.</span><span class="nf">not</span><span class="p">(</span><span class="ss">:role_id</span> <span class="o">=></span> <span class="n">roles</span><span class="p">.</span><span class="nf">map</span><span class="p">(</span><span class="o">&</span><span class="ss">:id</span><span class="p">)).</span><span class="nf">where</span><span class="p">(</span><span class="s2">"role_id IN (?)"</span><span class="p">,</span>
<span class="no">WorkflowTransition</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:tracker_id</span> <span class="o">=></span> <span class="n">tracker_id</span><span class="p">,</span> <span class="ss">:old_status_id</span> <span class="o">=></span> <span class="n">status_id</span><span class="p">).</span><span class="nf">select</span><span class="p">(</span><span class="ss">:role_id</span><span class="p">).</span><span class="nf">distinct</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">e</span><span class="o">|</span> <span class="n">e</span><span class="p">.</span><span class="nf">role_id</span> <span class="p">}</span>
<span class="p">).</span><span class="nf">to_a</span>
</code></pre>
<p>for this:</p>
<pre><code class="ruby syntaxhl"><span class="n">users</span> <span class="o">=</span> <span class="n">project</span><span class="p">.</span><span class="nf">assignable_users</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:type</span> <span class="o">=></span> <span class="n">types</span><span class="p">)</span>
<span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="s2">"role_id NOT IN (?)"</span><span class="p">,</span><span class="no">User</span><span class="p">.</span><span class="nf">current</span><span class="p">.</span><span class="nf">roles_for_project</span><span class="p">(</span><span class="n">project</span><span class="p">).</span><span class="nf">select</span><span class="p">(</span><span class="ss">:role_id</span><span class="p">).</span><span class="nf">distinct</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">e</span><span class="o">|</span> <span class="n">e</span><span class="p">.</span><span class="nf">role_id</span> <span class="p">})</span>
<span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="s2">"role_id IN (?)"</span><span class="p">,</span>
<span class="no">WorkflowTransition</span><span class="p">.</span><span class="nf">where</span><span class="p">(</span><span class="ss">:tracker_id</span> <span class="o">=></span> <span class="n">tracker_id</span><span class="p">,</span> <span class="ss">:old_status_id</span> <span class="o">=></span> <span class="n">status_id</span><span class="p">).</span><span class="nf">select</span><span class="p">(</span><span class="ss">:role_id</span><span class="p">).</span><span class="nf">distinct</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">e</span><span class="o">|</span> <span class="n">e</span><span class="p">.</span><span class="nf">role_id</span> <span class="p">}</span>
<span class="p">).</span><span class="nf">to_a</span>
</code></pre>