@vperms/core
v0.0.6
Published
Pure TypeScript permission-matching engine for VeguiPerms.
Maintainers
Readme
VeguiPerms Core
@vperms/core is the pure TypeScript engine behind VeguiPerms: matching,
precedence, inheritance traversal and permission resolution, without runtime
dependencies. Most applications should start with the validated vperms service.
Core guide · API reference · GitHub
Install
npm install @vperms/coreMatch a permission
import { matchesPattern, matchPermission } from "@vperms/core";
matchesPattern("projects.1.*", "projects.1.read"); // true
matchPermission(
[
{ permission: "projects.*", value: true, subjectId: "alice", workspaceId: "w" },
{ permission: "projects.1.*", value: false, subjectId: "alice", workspaceId: "w" },
],
"projects.1.read",
); // false: the more specific deny winsThe engine also exports VeguiPermsAdapter, shared subject/grant types,
resolveSubjectPermissions() and canResolved(). It performs no input validation;
use the service at application boundaries.
Build and coverage badges describe the whole VeguiPerms repository. License: MIT.
