# Security Decorator swagger schema classDecorator operation
Module | import { Security } from "@tsed/swagger" |
---|---|
Source | /packages/swagger/src/decorators/security.ts |
# Overview
function Security(securityDefinitionName: string, ...scopes: string[]): Function;
# Description
Add security metadata on the decorated method.
# Examples
# On method
@Controller("/")
class ModelCtrl {
@Security("write:calendars")
async method() {}
}
1
2
3
4
5
2
3
4
5
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing