Meteor-Community-Packages/meteor-roles

Get a list of users with a scope

開放

#388 建立於 2024年1月26日

 (13 則留言) (0 個反應) (0 位負責人)JavaScript (161 個分叉)batch import
enhancementgood first issue

倉庫指標

星標
 (919 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I see that there is a way to get the users with a specific role, but I'm interested in getting the users with a specific scope.

Say there were a project (Project 1), and the project had different roles. And I had multiple projects on my website (Project 1, Project 2, Project 3). I would like to get everyone associated with Project 1, regardless of their role.

So instead of

Roles.getUsersInRole('user-role')

I guess I'm asking if there's something like

Roles.getUsersInScope('project-name')

This was fairly easy to do in older versions of the package, with a query like this, if a user had been assigned to a project

return Meteor.users.find({"roles.__global_roles__": "project-1"});

But for v3, I didn't see this in the documentation anywhere - is it possible to do this currently?

貢獻者指南