Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

400
Vistas
How to implement RBAC permission in REST API (Nest.js Best Practice)

I am writing a REST API service where I need to add a layer of authorization for the endpoints I provide. I implemented authorization by using discrete permission on every controller using a guard/middleware.

  @Get('/clients')
  @hasPermissions('read', 'all')
  @UseGuards(PermissionsGuard)
  async getClient(@Query() query, @Res() res) { 
      ...
  }

My question is I need to add a layer of access depending on the owner of the resource. For example, if the user has an admin previllages he/she can see clients created by everyone, however, if the user has a privilege that is lower than the admin he/she can only see a client which created by himself/herself.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda