How to Enable Authorization Guard

To enable authorization guard, you can use one of two options:

Individually

You can set the Authorization guard for each method, or controller individually by using RequireAuthorization decorator.

For example,

import { RequireAuthorization } from '@tradinos/cms-backend-authorization';

@Controller()
@RequireAuthorization()
export class PokemonController {
  @Get()
  listPokemons(): Pokemon {
    /** Some code here */
  }
}

Globally

Please, check the following page

Last updated