https://github.com/wmfs/tymly-rbac-plugin
Role Based Access Control support plugin
https://github.com/wmfs/tymly-rbac-plugin
plugin rbac tymly
Last synced: 3 months ago
JSON representation
Role Based Access Control support plugin
- Host: GitHub
- URL: https://github.com/wmfs/tymly-rbac-plugin
- Owner: wmfs
- License: mit
- Created: 2018-08-23T09:32:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-08T15:53:31.000Z (3 months ago)
- Last Synced: 2025-04-15T12:10:05.332Z (3 months ago)
- Topics: plugin, rbac, tymly
- Language: JavaScript
- Size: 603 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tymly-rbac-plugin
[](https://tymly.io/)
[](https://www.npmjs.com/package/@wmfs/tymly-rbac-plugin)
[](https://circleci.com/gh/wmfs/tymly-rbac-plugin)
[](https://codecov.io/gh/wmfs/tymly-rbac-plugin)
[](https://www.codefactor.io/repository/github/wmfs/tymly-rbac-plugin)
[](https://dependabot.com/)
[](http://commitizen.github.io/cz-cli/)
[](https://standardjs.com)
[](https://github.com/wmfs/tymly-rbac-plugin/blob/master/LICENSE)> This plugin handles role based authentication
...
## Install
```bash
$ 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.
## Methods
`listUserRoles(userId)`
`checkAuthorization(userId, ctx, resourceType, resourceName, action)`
`ensureUserRoles(userId, roleIds)`
`refreshRbacIndex()`
[MIT](https://github.com/wmfs/tymly/blob/master/LICENSE)