@secure-access-control/nestjs
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -20,3 +20,6 @@ "use strict"; | ||
canActivate(context) { | ||
const isPublic = this.reflector.get("isAcmPublic", context.getHandler()); | ||
const IsWebhook = this.reflector.get("IsAcmWebhook", context.getHandler()); | ||
if (IsWebhook) | ||
return true; | ||
const IsPublic = this.reflector.get("IsAcmPublic", context.getHandler()); | ||
const IsService = this.reflector.get("IsAcmService", context.getHandler()); | ||
@@ -31,3 +34,3 @@ const IsDisable = this.reflector.get("IsAcmDisable", context.getHandler()); | ||
} | ||
if (isPublic) | ||
if (IsPublic) | ||
return true; | ||
@@ -34,0 +37,0 @@ if (IsService) |
export declare const AcmPublic: () => import("@nestjs/common").CustomDecorator<string>; | ||
export declare const AcmWebhook: () => import("@nestjs/common").CustomDecorator<string>; | ||
export declare const AcmService: () => import("@nestjs/common").CustomDecorator<string>; | ||
@@ -3,0 +4,0 @@ export declare const AcmDisable: () => import("@nestjs/common").CustomDecorator<string>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AcmHealth = exports.AcmDisable = exports.AcmService = exports.AcmPublic = void 0; | ||
exports.AcmHealth = exports.AcmDisable = exports.AcmService = exports.AcmWebhook = exports.AcmPublic = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
const AcmPublic = () => (0, common_1.SetMetadata)("isAcmPublic", true); | ||
const AcmPublic = () => (0, common_1.SetMetadata)("IsAcmPublic", true); | ||
exports.AcmPublic = AcmPublic; | ||
const AcmWebhook = () => (0, common_1.SetMetadata)("IsAcmWebhook", true); | ||
exports.AcmWebhook = AcmWebhook; | ||
const AcmService = () => (0, common_1.SetMetadata)("IsAcmService", true); | ||
@@ -8,0 +10,0 @@ exports.AcmService = AcmService; |
@@ -11,3 +11,6 @@ import { CanActivate, ExecutionContext, Injectable } from "@nestjs/common"; | ||
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> { | ||
const isPublic = this.reflector.get<boolean>("isAcmPublic", context.getHandler()); | ||
const IsWebhook = this.reflector.get<boolean>("IsAcmWebhook", context.getHandler()); | ||
if (IsWebhook) return true; | ||
const IsPublic = this.reflector.get<boolean>("IsAcmPublic", context.getHandler()); | ||
const IsService = this.reflector.get<boolean>("IsAcmService", context.getHandler()); | ||
@@ -25,3 +28,3 @@ | ||
} | ||
if (isPublic) return true; | ||
if (IsPublic) return true; | ||
if (IsService) return accessControlService.service(request); | ||
@@ -28,0 +31,0 @@ |
import { SetMetadata } from "@nestjs/common"; | ||
export const AcmPublic = () => SetMetadata("isAcmPublic", true); | ||
export const AcmPublic = () => SetMetadata("IsAcmPublic", true); | ||
export const AcmWebhook = () => SetMetadata("IsAcmWebhook", true); | ||
export const AcmService = () => SetMetadata("IsAcmService", true); | ||
@@ -6,0 +8,0 @@ |
{ | ||
"name": "@secure-access-control/nestjs", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "Sushin Pv", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29344
714