---
lang: en
title: 'API docs: authorization'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/authorization
permalink: /doc/en/lb4/apidocs.authorization.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/authorization](./authorization.md)

## authorization package

A LoopBack 4 component for authorization support (Role based, Permission based, Vote based)

## Remarks

To read on key building blocks read through [LoopBack authorization docs](https://loopback.io/doc/en/lb4/Loopback-component-authorization.html)

## Classes

<table><thead><tr><th>

Class


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[AuthorizationComponent](./authorization.authorizationcomponent.md)


</td><td>


</td></tr>
<tr><td>

[AuthorizationError](./authorization.authorizationerror.md)


</td><td>

The custom error class that describes the error thrown by the authorization module. Should be extracted to the common layer shared by authentication and authorization.


</td></tr>
<tr><td>

[AuthorizationInterceptor](./authorization.authorizationinterceptor.md)


</td><td>


</td></tr>
<tr><td>

[AuthorizeMethodDecoratorFactory](./authorization.authorizemethoddecoratorfactory.md)


</td><td>


</td></tr>
</tbody></table>

## Enumerations

<table><thead><tr><th>

Enumeration


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[AuthorizationDecision](./authorization.authorizationdecision.md)


</td><td>

Decisions for authorization


</td></tr>
</tbody></table>

## Functions

<table><thead><tr><th>

Function


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[authorize(spec)](./authorization.authorize.md)


</td><td>

Decorator `@authorize` to mark methods that require authorization


</td></tr>
<tr><td>

[getAuthorizationMetadata(target, methodName)](./authorization.getauthorizationmetadata.md)


</td><td>

Fetch authorization metadata stored by `@authorize` decorator.


</td></tr>
</tbody></table>

## Interfaces

<table><thead><tr><th>

Interface


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[AuthorizationContext](./authorization.authorizationcontext.md)


</td><td>

Request context for authorization


</td></tr>
<tr><td>

[AuthorizationMetadata](./authorization.authorizationmetadata.md)


</td><td>

Authorization metadata supplied via `@authorize` decorator


</td></tr>
<tr><td>

[AuthorizationOptions](./authorization.authorizationoptions.md)


</td><td>


</td></tr>
<tr><td>

[AuthorizationRequest](./authorization.authorizationrequest.md)


</td><td>

Inspired by https://github.com/casbin/node-casbin


</td></tr>
<tr><td>

[Enforcer](./authorization.enforcer.md)


</td><td>

An enforcer of authorization policies


</td></tr>
</tbody></table>

## Namespaces

<table><thead><tr><th>

Namespace


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[AuthorizationBindings](./authorization.authorizationbindings.md)


</td><td>

Binding keys used by authorization component.


</td></tr>
<tr><td>

[AuthorizationTags](./authorization.authorizationtags.md)


</td><td>

Binding tags used by authorization component


</td></tr>
<tr><td>

[authorize](./authorization.authorize.md)


</td><td>


</td></tr>
</tbody></table>

## Variables

<table><thead><tr><th>

Variable


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[ANONYMOUS](./authorization.anonymous.md)


</td><td>


</td></tr>
<tr><td>

[AUTHENTICATED](./authorization.authenticated.md)


</td><td>


</td></tr>
<tr><td>

[AUTHORIZATION\_CLASS\_KEY](./authorization.authorization_class_key.md)


</td><td>


</td></tr>
<tr><td>

[AUTHORIZATION\_METHOD\_KEY](./authorization.authorization_method_key.md)


</td><td>


</td></tr>
<tr><td>

[EVERYONE](./authorization.everyone.md)


</td><td>

Built-in roles


</td></tr>
<tr><td>

[UNAUTHENTICATED](./authorization.unauthenticated.md)


</td><td>


</td></tr>
</tbody></table>

## Type Aliases

<table><thead><tr><th>

Type Alias


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[Authorizer](./authorization.authorizer.md)


</td><td>

A function to decide if access to the target should be allowed or denied


</td></tr>
</tbody></table>

