Skip to content

Commit

Permalink
Changed IAM.all to IAM.everyone to be consistent with role names.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed Oct 9, 2020
1 parent 89ad5d5 commit 1c008da
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@author.io/iam",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"description": "A Identification and Authorization Management library.",
"main": "src/index.js",
"module": "index.js",
Expand Down
7 changes: 6 additions & 1 deletion src/lib/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class Registry extends Base {
* of a reserved role: `everyone`.
* @param {Object} [acl={}]
*/
all (acl = {}) {
everyone (acl = {}) {
const role = this.role('everyone')

if (role) {
Expand All @@ -419,6 +419,11 @@ class Registry extends Base {
}
}

all () {
console.warn('IAM.all() is deprecated. Use IAM.everyone() instead.')
this.everyone(...arguments)
}

/**
* Create new groups. This accepts any number of string arguments,
* where each string represents the unique name of a system group.
Expand Down
2 changes: 1 addition & 1 deletion tests/04-role.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test('Internal/Hard Coded Roles', t => {

IAM.createResource('simple', ['create', 'read', 'update', 'delete'])

IAM.all({
IAM.everyone({
simple: ['deny:create', 'read'],
other: 'read'
})
Expand Down
2 changes: 1 addition & 1 deletion tests/06-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test('Inherited Permissions', t => {
IAM.removeResource()
IAM.createResource('public', CRUD)
IAM.createResource('adminportal', CRUD)
IAM.all({
IAM.everyone({
public: '*',
adminportal: 'deny:*'
})
Expand Down
2 changes: 1 addition & 1 deletion tests/07-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('Generate Configuration', t => {
public: CRUD
})

IAM.all({
IAM.everyone({
public: '*',
adminportal: 'deny:*'
})
Expand Down

0 comments on commit 1c008da

Please sign in to comment.