This plugin handles role based authentication
...
$ npm install tymly-rbac-plugin --save
Add to your list of Tymly plugin's using
await tymly.boot({
blueprintPaths: [
...
],
pluginPaths: [
path.resolve('@wmfs/tymly-rbac-plugin'),
...
]
},
...
The RBAC service will initialise itself from state machine restrictions. Users can be added to groups using the ensureUserRole methods, or by populating the role and role-membership tables.
Tymly's Statebox service is RBAC aware and so, if this plugin is loaded, will using this service to control access to state machines.
listUserRoles(userId)
checkAuthorization(userId, ctx, resourceType, resourceName, action)
ensureUserRoles(userId, roleIds)
refreshRbacIndex()