Skip to content

Security

@tsed/schema

Usage

typescript
import { Security } from "@tsed/schema";

See /packages/specs/schema/src/types/decorators/operations/security.ts.

Overview

ts
function Security(name: string, ...scopes: string[]): ClassDecorator & MethodDecorator;

export function Security(security: OpenSpecSecurity): ClassDecorator & MethodDecorator;

Description

Add security metadata on the decorated method.

Examples

On method

typescript
@Controller("/")
class ModelCtrl {
   @Security("write:calendars")
   async method() {}
}

Released under the MIT License.