https://github.com/nestrx/access-control
Module Access control for NestJS
https://github.com/nestrx/access-control
access-control nestjs rbac
Last synced: 19 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 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-05T23:22:06.000Z (over 6 years ago)
- Last Synced: 2025-09-03T19:53:42.968Z (about 2 months ago)
- Topics: access-control, nestjs, rbac
- Language: TypeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- 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
}
}
...
```