Created
January 22, 2016 21:15
-
-
Save themeteorchef/2c8a293435fb44e0c034 to your computer and use it in GitHub Desktop.
Roles Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Companies = new Meteor.Collection(); | |
{ | |
"Company 1": { | |
_id: "companyOne", | |
roles: [ | |
'bacon', | |
'eggs', | |
'biscuits' | |
] | |
} | |
"Company 2": { | |
_id: "companyTwo", | |
roles: { | |
"admins": [ | |
'apples', | |
'oranges', | |
'bananas' | |
], | |
"employees": [ | |
'yahtzee', | |
'monopoly', | |
'jenga' | |
] | |
} | |
} | |
"Company 3": {} | |
"Company 4": {} | |
} | |
{ _id: "dougbacon" email: "[email protected]", roles: [ 'bacon', 'eggs' ] } | |
{ _id: "janeapples" email: "[email protected]", roles: [ 'apples' ] } | |
Roles.addUsersToRoles( "janeapples", [ 'oranges' ] ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment