@superawesome/permissions-nestjs
Version:
NestJS Guard & Decorators for @superawesome/permissions, promoting orthogonal fine-grained API access control to resources.
31 lines (23 loc) • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PermitGrant = exports.PermitGrantQuery = void 0;
const common_1 = require("@nestjs/common");
/**
* See [reference in details example](/additional-documentation/reference-&-detailed-example.html)
*/
class PermitGrantQuery {
}
exports.PermitGrantQuery = PermitGrantQuery;
/**
An optional method/endpoint Guard that allows you to either:
a) turn off the guard for this endpoint, by passing the literal `false`. This will make the endpoint open to even non authenticated users.
b) Pass an object of type `PermitGrantQuery` to set one or more of:
- a `resource` name different than the Controller's `createPermissionsGuard` default `resource`.
- an `action` name different than the method's name.
- a `resourceIdKey` name different than just `id`.
- a `resourceIdsKey` name different than just `ids`.
See [reference in detailed example](/additional-documentation/reference-&-detailed-example.html)
@param permitGrant: PermitGrantQuery | false
*/
exports.PermitGrant = (permitGrantArgs = {}) => common_1.SetMetadata('permitGrant', permitGrantArgs);
//# sourceMappingURL=PermitGrant.decorator.js.map