Meteor-Community-Packages / meteor-roles

Authorization package for Meteor, compatible with built-in accounts packages
http://meteor-community-packages.github.io/meteor-roles/
MIT License
920 stars 167 forks source link

suggestion: getRolesForUser method have option to return scope roles only #313

Closed Slavrix closed 4 years ago

Slavrix commented 4 years ago

It would be useful to extend the getRolesForUser method to allow for it to return roles for the scope only, if a scope is provided.

currently if you provide a scope, it returns an array that includes the roles for that scope AND the global scope.

Use Case: Administrators of a Scope are allowed to create their own roles/permissions and name them what they choose. We don't want the Scope Admins to be able to view global roles that are included by developers. eg super administrators, vip users, early adoptor flags etc.

SimonSimCity commented 4 years ago

Isn't this covered by the setting onlyScoped, added in version 3.2.0?

https://github.com/Meteor-Community-Packages/meteor-roles/blob/32c230ded9cb92b27a3485d143cabf2732fef186/roles/roles_common.js#L706-L723

Slavrix commented 4 years ago

Probably helps if I read things fully right..... :D

On Sun, 16 Feb. 2020, 4:19 pm Simon Schick, notifications@github.com wrote:

Isn't this covered by the setting onlyScoped?

https://github.com/Meteor-Community-Packages/meteor-roles/blob/32c230ded9cb92b27a3485d143cabf2732fef186/roles/roles_common.js#L706-L723

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Meteor-Community-Packages/meteor-roles/issues/313?email_source=notifications&email_token=ACVUD7Z3AX5JQYMQQVFYDLTRDDEG3A5CNFSM4KV6TNB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL36DQY#issuecomment-586670531, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVUD7523UQO72NFEOBFNSTRDDEG3ANCNFSM4KV6TNBQ .