Skip to content

Comments

added method getUserIdsInRoleAsync#420

Open
bratelefant wants to merge 1 commit intoMeteor-Community-Packages:masterfrom
bratelefant:master
Open

added method getUserIdsInRoleAsync#420
bratelefant wants to merge 1 commit intoMeteor-Community-Packages:masterfrom
bratelefant:master

Conversation

@bratelefant
Copy link
Contributor

@bratelefant bratelefant commented Jul 12, 2025

Roles can also be used to add roles to userIds which are actually not user ids at all; typical usecase could be adding roles and scopes to apikeys or device-ids (for example if you use device code flow for oauth2). In the docs, this functionality is intended (parameter users is described as User ID(s) or object(s) with an _id field.)

However, if you want to get a full list of ids that have a certain role or/and scope, there is no method to accomplish this. The existing getUsersInRoleAsync method relies on the Meteor.users collection.

So I added a method getUserIdsInRoleAsync method, that only returns an array of those ids that have the given role+scope, in order to provide this functionality to userIds which are not actual Meteor.users.

@StorytellerCZ
Copy link
Member

Thanks for the PR, can you please make the same against Meteor core?

@bratelefant
Copy link
Contributor Author

Thanks for the PR, can you please make the same against Meteor core?

Sure, I can do that; whats the canonical way to do that? Seems like this is not a good constellation, to have this repo in parallel development to the core package...

@StorytellerCZ
Copy link
Member

Just open up the same PR against the core in the package and link to this PR. Once merged into core, we can merge this PR and do a release here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants