@cloudbourn/scheduler-permissions
v1.0.2
Published
Utilities for reading and writing permission bitmasks
Downloads
4
Readme
@cloudbourn/scheduler-permissions
Utility package to parse and write org permissions.
Usage
const { parseOrgPermissions } = require('@cloudbourn/scheduler-permissions')
const orgPermissions = parseOrgPermissions( await permissions.getByUser(req.userId) )
orgPermissions
is now internally represented as:
[
{
"userId":"user-123",
"organisationId":"org-123",
"permissions": {
"ADMIN": true,
"BILLING": false,
"API_KEYS": false,
"MEMBERS": false
}
}
]
but when JSON.stringify'd:
[
{
"userId":"user-123",
"organisationId":"org-123",
"permissions": 1
}
]