Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2.0] support onlyAssigned option for method getUsersInRole #177

Open
jsamr opened this issue Feb 1, 2016 · 3 comments
Open

[v2.0] support onlyAssigned option for method getUsersInRole #177

jsamr opened this issue Feb 1, 2016 · 3 comments
Labels
enhancement good first issue This is an easy issue that beginners can tackle to get to know the code base. help wanted

Comments

@jsamr
Copy link
Contributor

jsamr commented Feb 1, 2016

Use case
In my model, 'project.member' is a sub-role of 'project.manager'. If I want a list of all project members that are not managers, AFAIK I cannot yet. Well yes, I can filter the output of getUsersInRole but that's not convenient.

Solution
The method getRolesForUser already support this option :

onlyAssigned: return only assigned roles and not automatically inferred (like subroles)

So basically, the idea is to filter users which role param has an assigned:true field, perhaps using Roles._onlyAssignedMatcher method.

@mitar
Copy link
Member

mitar commented Feb 1, 2016

Can you elaborate?

@jsamr
Copy link
Contributor Author

jsamr commented Feb 1, 2016

I updated the above comment.

@jsamr jsamr changed the title [v2.0] support onlyAssigned:true option for method getUsersInRole [v2.0] support onlyAssigned option for method getUsersInRole Feb 1, 2016
@mitar
Copy link
Member

mitar commented Apr 4, 2016

Yes, this sounds reasonable. Pull request welcome.

@SimonSimCity SimonSimCity added good first issue This is an easy issue that beginners can tackle to get to know the code base. and removed v2 labels Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue This is an easy issue that beginners can tackle to get to know the code base. help wanted
Projects
None yet
Development

No branches or pull requests

3 participants