UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

126 lines (59 loc) 2.78 kB
--- lang: en title: 'API docs: authorization.authorizationoptions' 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.authorizationoptions.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/authorization](./authorization.md) &gt; [AuthorizationOptions](./authorization.authorizationoptions.md) ## AuthorizationOptions interface **Signature:** ```typescript export interface AuthorizationOptions ``` ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> [defaultDecision?](./authorization.authorizationoptions.defaultdecision.md) </td><td markdown="1"> </td><td markdown="1"> [AuthorizationDecision.DENY](./authorization.authorizationdecision.md) \| [AuthorizationDecision.ALLOW](./authorization.authorizationdecision.md) </td><td markdown="1"> _(Optional)_ Default decision if all authorizers vote for ABSTAIN If not set, default to `AuthorizationDecision.DENY` </td></tr> <tr><td markdown="1"> [defaultMetadata?](./authorization.authorizationoptions.defaultmetadata.md) </td><td markdown="1"> </td><td markdown="1"> [AuthorizationMetadata](./authorization.authorizationmetadata.md) </td><td markdown="1"> _(Optional)_ Default authorization metadata if a method is not decorated with `@authorize`<!-- -->. If not set, no authorization will be enforced for those methods that are not associated with authorization metadata. </td></tr> <tr><td markdown="1"> [defaultStatusCodeForDeny?](./authorization.authorizationoptions.defaultstatuscodefordeny.md) </td><td markdown="1"> </td><td markdown="1"> number </td><td markdown="1"> _(Optional)_ Default HTTP status code when the final decision is `AuthorizationDecision.DENY`<!-- -->. If not set, default to 403 </td></tr> <tr><td markdown="1"> [precedence?](./authorization.authorizationoptions.precedence.md) </td><td markdown="1"> </td><td markdown="1"> [AuthorizationDecision.DENY](./authorization.authorizationdecision.md) \| [AuthorizationDecision.ALLOW](./authorization.authorizationdecision.md) </td><td markdown="1"> _(Optional)_ Controls if Allow/Deny vote takes precedence and override other votes. If not set, default to `AuthorizationDecision.DENY`<!-- -->. Once a vote matches the `precedence`<!-- -->, it becomes the final decision. The rest of votes will be skipped. </td></tr> </tbody></table>