Skip to content

Commit

Permalink
Merge branch 'role-assign-collection'
Browse files Browse the repository at this point in the history
# Conflicts:
#	History.md
#	package.js
  • Loading branch information
SimonSimCity committed Nov 13, 2019
2 parents 0f7fc6f + 0ad199f commit fc9b55a
Show file tree
Hide file tree
Showing 53 changed files with 5,201 additions and 13,446 deletions.
6 changes: 6 additions & 0 deletions .coverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"include": [
"**/packages/roles/**/*",
"**/packages/*alanning_roles.js"
]
}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ results
npm-debug.log
smart.lock

.idea
.idea
docs/
node_modules/
.npm/
someapp/
4 changes: 2 additions & 2 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[email protected]
[email protected]
alanning:[email protected].0
alanning:[email protected].1
[email protected]
[email protected]
[email protected]
Expand All @@ -26,7 +26,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
local-test:alanning:[email protected].0
local-test:alanning:[email protected].1
[email protected]
[email protected]
[email protected]
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ those roles easier.
<a id="roles-naming" name="roles-naming"></a>
### Permissions vs roles (or What's in a name...)

Although the name of this package is `roles`, you can define your **roles**, **groups** or **permissions** however you like.
Although the name of this package is `roles`, you can define your **roles**, **scopes** or **permissions** however you like.
They are essentially just tags that you assign to a user and which you can check upon later.

You can have traditional roles like, `admin` or `webmaster`, or you can assign more granular permissions such
Expand Down Expand Up @@ -212,7 +212,7 @@ var users = [
{name:"Admin User",email:"[email protected]",roles:['admin']}
];

_.each(users, function (user) {
users.forEach(function (user) {
var id;

id = Accounts.createUser({
Expand All @@ -222,7 +222,7 @@ _.each(users, function (user) {
});

if (user.roles.length > 0) {
_.each(user.roles, function (role) {
user.roles.forEach(function (role) {
Roles.createRole(role, {unlessExists: true});
});
// Need _id of existing user record so this call must come after `Accounts.createUser`.
Expand All @@ -245,7 +245,7 @@ Check user roles before publishing sensitive data:
```js
// server/publish.js

// Give authorized users access to sensitive data by group
// Give authorized users access to sensitive data by scope
Meteor.publish('secrets', function (scope) {
check(scope, String);

Expand Down
25 changes: 0 additions & 25 deletions docs/api.js

This file was deleted.

Binary file removed docs/assets/css/external-small.png
Binary file not shown.
Binary file removed docs/assets/css/logo.png
Binary file not shown.
Loading

0 comments on commit fc9b55a

Please sign in to comment.