0.0.2 • Published 5 years ago

@nestrx/access-control v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

ACCESS CONTROL

The module encryption AES GCM for NestJS framework.

Installation

npm:

npm i @nestrx/access-control

yan

yan add @nestrx/access-control

Configure

app.module.ts

...
@Module({
	...
	imports: [
		...
		AccessControlModule,
		...
	],
	...
})
...

Usage

your.controller.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
	}
}
...