Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nestrx/access-control
Module Access control for NestJS
https://github.com/nestrx/access-control
access-control nestjs rbac
Last synced: 7 days ago
JSON representation
Module Access control for NestJS
- Host: GitHub
- URL: https://github.com/nestrx/access-control
- Owner: nestrx
- License: mit
- Created: 2019-04-05T22:03:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-05T23:22:06.000Z (over 5 years ago)
- Last Synced: 2024-10-07T02:05:40.660Z (about 1 month ago)
- Topics: access-control, nestjs, rbac
- Language: TypeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ACCESS CONTROL
The module encryption AES GCM for [NestJS framework](https://nestjs.com/).## Installation
npm:
```bash
npm i @nestrx/access-control
```
yan
```bash
yan add @nestrx/access-control
```## Configure
app.module.ts
```ts
...
@Module({
...
imports: [
...
AccessControlModule,
...
],
...
})
...
```## Usage
your.controller.ts
```ts
...
@Controller('route')
export class YourController{@Get()
@Role() // default user role
action(@Query() query: any): string{
// todo something
}
@Post()
@Role('admin')
adminAccess(@Body() data: any, @User('id') accessBy: string): string{
// todo something
}
}
...
```