reactioncommerce / meteor-security

A Meteor package: Logical MongoDB security

Home Page:https://atmospherejs.com/ongoworks/security

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow group argument in "ifHasRole" signature

jthomaschewski opened this issue · comments

The "alanning:roles" package allows to check permission by group since version 1.1.0.
It would be great to be able to use the "userIsInRole(user, roles, group)" signature from meteor-security.

e.g:

Posts.permit('remove').ifHasRole('admin', 'company1.com').apply();

or even in array syntax:

Posts.permit('remove').ifHasRole(['admin', 'posts-admin'], 'company1.com').apply();

Implemented with object arg since we only support a single arg. See updated docs: https://github.com/ongoworks/meteor-security#built-in-rule-chain-methods