Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "@a38/core", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"exports": { | ||
@@ -5,0 +5,0 @@ ".": { |
@@ -12,3 +12,3 @@ import type { HRBAC } from './hrbac.js'; | ||
privilege: string | null | ||
) => boolean; | ||
) => boolean | Promise<boolean>; | ||
@@ -40,3 +40,3 @@ export interface SerializedRule { | ||
match(hrbac: HRBAC, role: ROLE, resource: RESOURCE, privilege: string | null): boolean { | ||
async match(hrbac: HRBAC, role: ROLE, resource: RESOURCE, privilege: string | null): Promise<boolean> { | ||
if (null === privilege) { | ||
@@ -48,3 +48,3 @@ if (this.privileges) return false; | ||
return !this.assertion || this.assertion(hrbac, role, resource, privilege); | ||
return !this.assertion || (await this.assertion(hrbac, role, resource, privilege)); | ||
} | ||
@@ -51,0 +51,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
77661