Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-27T21:52:50.000Z (4 months ago)
- Last Synced: 2024-10-14T06:44:38.962Z (3 months ago)
- Topics: plugin, rbac, tymly
- Language: JavaScript
- Size: 572 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tymly-rbac-plugin
[![Tymly Plugin](https://img.shields.io/badge/tymly-plugin-blue.svg)](https://tymly.io/)
[![npm (scoped)](https://img.shields.io/npm/v/@wmfs/tymly-rbac-plugin.svg)](https://www.npmjs.com/package/@wmfs/tymly-rbac-plugin)
[![CircleCI](https://circleci.com/gh/wmfs/tymly-rbac-plugin.svg?style=svg)](https://circleci.com/gh/wmfs/tymly-rbac-plugin)
[![codecov](https://codecov.io/gh/wmfs/tymly-rbac-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/wmfs/tymly-rbac-plugin)
[![CodeFactor](https://www.codefactor.io/repository/github/wmfs/tymly-rbac-plugin/badge)](https://www.codefactor.io/repository/github/wmfs/tymly-rbac-plugin)
[![Dependabot badge](https://img.shields.io/badge/Dependabot-active-brightgreen.svg)](https://dependabot.com/)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](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)