# Decorator Security
Decorator swagger schema classDecorator operationModule | import { Security } from "@tsed/schema" |
---|---|
Source | /packages/schema/src/decorators/operations/security.ts |
# Overview
function Security(name: string, ...scopes: string[]): (...args: any[]) => any;
# 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
Other topics
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Seq
- OIDC
- Stripe
- Controllers
- Providers
- Model
- JsonMapper
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Exceptions
- Hooks
- Response Filter
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing