-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev(examples): add ACL runnable example * fix(typedefs): ACL type * docs(ACL): typo in permissions key * bump version to 6.2.1 with changelog
- Loading branch information
1 parent
83c759d
commit 2fa29b4
Showing
6 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const { getClient, constants } = require('./wrapper'); | ||
|
||
const logger = require('./logger'); | ||
const notifier = require('./notifier'); | ||
|
||
notifier.on('connect', (message) => logger.log('connect', message)); | ||
notifier.on('createNode', (message) => logger.log('createNode', message)); | ||
|
||
async function init() { | ||
const client = getClient(); | ||
|
||
client.on('connect', async () => { | ||
const path = '/acl-testing'; | ||
const data = ''; | ||
const flags = constants.ZOO_EPHEMERAL; | ||
const version = 0; | ||
|
||
await client.create(path, data, flags); | ||
|
||
const before = await client.get_acl(path); | ||
|
||
const updatedAcl = [{ | ||
perm: constants.ZOO_PERM_READ, | ||
scheme: 'world', | ||
auth: 'anyone', | ||
}]; | ||
|
||
await client.set_acl(path, version, updatedAcl); | ||
|
||
const after = await client.get_acl(path); | ||
|
||
logger.log('before:', before[0]); | ||
logger.log('after:', after[0]); | ||
}); | ||
} | ||
|
||
if (require.main === module) { | ||
init().catch(logger.error); | ||
} |
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
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
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