{"_id":"@a38/core","_rev":"6-cb0b1e5b939ab2f7ea424a8530bf0e2b","name":"@a38/core","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"@a38/core","version":"0.0.1","_id":"@a38/core@0.0.1","dist":{"shasum":"981af7c3c95f0c793ebe7255fad7193d85245a44","tarball":"https://registry.npmjs.org/@a38/core/-/core-0.0.1.tgz","fileCount":22,"integrity":"sha512-/hS8GBfA8VNTHK51q6pqvTxy6orTl2ClwJ/a46kP9AcjlsnKFXhY+YnbLnAMxIvFX+2pZ73IcJaOlStT6kFpaA==","signatures":[{"sig":"MEUCIH13ujJIaWGMI0jEaTfOSYGD4eX0NmecjX6wVHIqc7C+AiEAz6fjenVFPSxolio11A96e0NBQuLwErVjzN7T/YLP9JI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":69018},"main":"./lib/index.js","types":"./src/index.ts","module":"./lib/index.mjs","exports":{".":{"bun":"./src/index.ts","types":"./src/index.ts","import":"./lib/index.mjs","require":"./libs/index.js"}},"gitHead":"80729b1a0ece8b709b191390a57ceb8757ba0a46","scripts":{"lint":"biome lint .","test":"bun test","build":"tsup src/index.ts --format cjs,esm --out-dir lib","test:watch":"bun test --watch","lint:staged":"biome check . --staged --no-errors-on-unmatched --write","lint:changed":"biome check . --changed --no-errors-on-unmatched","test:coverage":"bun test --coverage"},"_npmUser":{"name":"draconisnoctis","email":"mark.wecke@gmail.com"},"_npmVersion":"10.2.4","description":"Core of the A38 hierarchical RBAC library","directories":{},"_nodeVersion":"21.6.1","_hasShrinkwrap":false,"devDependencies":{"ts-node":"10.9.2","typescript":"5.5.2","@types/node":"20.14.9","@a38/typedoc":"0.0.1","@a38/tsconfig":"0.0.1","@a38/biome-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.1_1719903452763_0.3165446574704067","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@a38/core","version":"0.0.2","_id":"@a38/core@0.0.2","maintainers":[{"name":"draconisnoctis","email":"mark.wecke@gmail.com"}],"dist":{"shasum":"f86bf077b9887773bf911a051fa38d69e05e5b67","tarball":"https://registry.npmjs.org/@a38/core/-/core-0.0.2.tgz","fileCount":22,"integrity":"sha512-3s6ALMU54lxNde6UFG5vv3YHOLBIdoYohDRmSaV/n5O6tanoUMn9u/0UlPbY0x2oO+pHmFmyBUyRpPl2xtEFKw==","signatures":[{"sig":"MEUCIECoYmrtNjT0YeDkQsG1An4qzn46rHcrjPIeWdZYdQHjAiEA/vsqnBAn9Z5NE+YRn3qfbyM9a5BhRp9BeQ5RGwa4rIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74202},"main":"./lib/index.js","types":"./src/index.ts","module":"./lib/index.mjs","exports":{".":{"bun":"./src/index.ts","types":"./src/index.ts","import":"./lib/index.mjs","require":"./libs/index.js"}},"gitHead":"73d2f49ee1544203edd890c7c6ce27bf1ba3b23c","scripts":{"lint":"biome lint .","test":"bun test","build":"tsup src/index.ts --format cjs,esm --out-dir lib","test:watch":"bun test --watch","lint:staged":"biome check . --staged --no-errors-on-unmatched --write","lint:changed":"biome check . --changed --no-errors-on-unmatched","test:coverage":"bun test --coverage"},"_npmUser":{"name":"draconisnoctis","email":"mark.wecke@gmail.com"},"_npmVersion":"10.7.0","description":"Core of the A38 hierarchical RBAC library","directories":{},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.4.5","@types/node":"20.14.9","@a38/typedoc":"0.0.1","@a38/tsconfig":"0.0.1","@a38/biome-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.2_1720079117741_0.3835628735400851","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@a38/core","version":"0.0.3","_id":"@a38/core@0.0.3","maintainers":[{"name":"draconisnoctis","email":"mark.wecke@gmail.com"}],"dist":{"shasum":"eb6cb2bdad61c1ed5800f54411c7ef5b969402ef","tarball":"https://registry.npmjs.org/@a38/core/-/core-0.0.3.tgz","fileCount":22,"integrity":"sha512-nPjVrxYq8EQcmrRIhZXiDsN42L+Q06OfqmubKM1dCxmExm84RH8kxtjBpe6R85IRXQO3dA2JEtQfbWhBHvwCWw==","signatures":[{"sig":"MEUCIQCakRv6um2FcDIgG9jnb+tyiDPQYArYRSvXYfRMAeWhKAIgWa2Zjwwu+hgCIaEjJcA3cX0S1B87flD6mlEi1qX/jRE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":77708},"main":"./lib/index.js","types":"./src/index.ts","module":"./lib/index.mjs","exports":{".":{"bun":"./src/index.ts","types":"./src/index.ts","import":"./lib/index.mjs","require":"./libs/index.js"}},"gitHead":"e4650632fb38168e72e7d3b5a8418d7a6c44a6a4","scripts":{"lint":"biome lint .","test":"bun test","build":"tsup src/index.ts --format cjs,esm --out-dir lib","test:watch":"bun test --watch","lint:staged":"biome check . --staged --no-errors-on-unmatched --write","lint:changed":"biome check . --changed --no-errors-on-unmatched","test:coverage":"bun test --coverage"},"_npmUser":{"name":"draconisnoctis","email":"mark.wecke@gmail.com"},"_npmVersion":"10.7.0","description":"Core of the A38 hierarchical RBAC library","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.5.4","@types/node":"20.14.15","@a38/typedoc":"0.0.1","@a38/tsconfig":"0.0.1","@a38/biome-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.3_1723449644196_0.2083948912145197","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@a38/core","version":"0.0.4","_id":"@a38/core@0.0.4","maintainers":[{"name":"draconisnoctis","email":"mark.wecke@gmail.com"}],"dist":{"shasum":"cd602a585bd364673e244b603bf03f9f7b17ca28","tarball":"https://registry.npmjs.org/@a38/core/-/core-0.0.4.tgz","fileCount":22,"integrity":"sha512-sdsHheeARy6hD7f8TAsQosjsHQulFZMZLWB0FuiqjesHT2/rjLxX4v+znj1vthqBaY+enAC42r7joH31jO8i0g==","signatures":[{"sig":"MEUCIQCjkOdtn4/Czh4ynhE+uY3JbRUs/fl6F3c0Ad4zEuj/wgIgTvMSu2jYwSN/UgWT1oVteJdjmySDQkAFtkRuv9D7VdI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":77661},"main":"./lib/index.js","types":"./src/index.ts","module":"./lib/index.mjs","exports":{".":{"bun":"./src/index.ts","types":"./src/index.ts","import":"./lib/index.mjs","require":"./libs/index.js"}},"gitHead":"17ddb19fbfee4ab5595cc8a88f42c617d4e68785","scripts":{"lint":"biome lint .","test":"bun test","build":"tsup src/index.ts --format cjs,esm --out-dir lib","test:watch":"bun test --watch","lint:staged":"biome check . --staged --no-errors-on-unmatched --write","lint:changed":"biome check . --changed --no-errors-on-unmatched","test:coverage":"bun test --coverage"},"_npmUser":{"name":"draconisnoctis","email":"mark.wecke@gmail.com"},"_npmVersion":"10.7.0","description":"Core of the A38 hierarchical RBAC library","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.5.4","@types/node":"20.14.15","@a38/typedoc":"0.0.1","@a38/tsconfig":"0.0.1","@a38/biome-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.4_1723449854652_0.0002863252980953579","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@a38/core","version":"0.0.5","_id":"@a38/core@0.0.5","maintainers":[{"name":"draconisnoctis","email":"mark.wecke@gmail.com"}],"dist":{"shasum":"cbbd24788b161f29f74d2e857b867eec57aec696","tarball":"https://registry.npmjs.org/@a38/core/-/core-0.0.5.tgz","fileCount":22,"integrity":"sha512-XmCiZ9EDKmqNJhJ1qsqu/h1odfcFtMn1ONyauh8GKmVLBf2gy9H0oYjB9gjVa501CnkKJNVv4riZaXL4wc1bJA==","signatures":[{"sig":"MEQCIF05dn7YCqPhtchxTnDlpt/Sic5YH/AKsLeGOtIJfRoQAiB/HVV/NDQQHHUM5ljG/g6qIa0nQMvdsx5znfSc8hTavQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":77800},"main":"./lib/index.js","types":"./src/index.ts","module":"./lib/index.mjs","exports":{".":{"bun":"./src/index.ts","types":"./src/index.ts","import":"./lib/index.mjs","require":"./lib/index.js"}},"gitHead":"835a374ae7fe3a202ccae42e9b0d93b16cbb911b","scripts":{"lint":"biome lint .","test":"bun test","build":"tsup src/index.ts --format cjs,esm --out-dir lib","test:watch":"bun test --watch","lint:staged":"biome check . --staged --no-errors-on-unmatched --write","lint:changed":"biome check . --changed --no-errors-on-unmatched","test:coverage":"bun test --coverage"},"_npmUser":{"name":"draconisnoctis","email":"mark.wecke@gmail.com"},"_npmVersion":"10.8.2","description":"Core of the A38 hierarchical RBAC library","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.5.4","@types/node":"20.16.5","@a38/typedoc":"0.0.1","@a38/tsconfig":"0.0.1","@a38/biome-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.5_1733735749600_0.01087146095819369","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@a38/core","version":"0.0.6","_id":"@a38/core@0.0.6","maintainers":[{"name":"draconisnoctis","email":"mark.wecke@gmail.com"}],"dist":{"shasum":"e80377823bbe076c8a94a4b5f34f3acabf69695c","tarball":"https://registry.npmjs.org/@a38/core/-/core-0.0.6.tgz","fileCount":22,"integrity":"sha512-tdMKauTdHR8E3anVqTuxDh9EKmnPwemrtV5Wy9jgMPV+GJt5Eqrk2L595Z2iNJUB4PnKalNjRKcTv1wuLOaLng==","signatures":[{"sig":"MEQCIEDu0NtFvf1o5AAmg18q3Jxuh9H+csC8cm4XpporW4WJAiBgU/jIN+7u46GlnbuasruYaq7WIcLqxMFrGqlv8E0REA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81071},"main":"./lib/index.js","types":"./src/index.ts","module":"./lib/index.mjs","exports":{".":{"bun":"./src/index.ts","types":"./src/index.ts","import":"./lib/index.mjs","require":"./lib/index.js"}},"gitHead":"c0fa2fe9b9a38b9e33d85d65aab9f9f38cc1db7f","scripts":{"lint":"biome lint .","test":"bun test","build":"tsup src/index.ts --format cjs,esm --out-dir lib","test:watch":"bun test --watch","lint:staged":"biome check . --staged --no-errors-on-unmatched --write","lint:changed":"biome check . --changed --no-errors-on-unmatched","test:coverage":"bun test --coverage"},"_npmUser":{"name":"draconisnoctis","email":"mark.wecke@gmail.com"},"_npmVersion":"10.8.2","description":"Core of the A38 hierarchical RBAC library","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.5.4","@types/node":"20.16.5","@a38/typedoc":"0.0.1","@a38/tsconfig":"0.0.1","@a38/biome-config":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.6_1733909089069_0.606828309952862","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@a38/core","version":"0.0.7","exports":{".":{"bun":"./src/index.ts","require":"./lib/index.js","import":"./lib/index.mjs","types":"./src/index.ts"}},"main":"./lib/index.js","module":"./lib/index.mjs","types":"./src/index.ts","scripts":{"build":"tsup src/index.ts --format cjs,esm --out-dir lib","lint":"biome lint .","lint:changed":"biome check . --changed --no-errors-on-unmatched","lint:staged":"biome check . --staged --no-errors-on-unmatched --write","test":"bun test","test:coverage":"bun test --coverage","test:watch":"bun test --watch"},"devDependencies":{"@a38/biome-config":"0.0.1","@a38/tsconfig":"0.0.1","@a38/typedoc":"0.0.1","@types/node":"20.16.5","typescript":"5.5.4"},"_id":"@a38/core@0.0.7","gitHead":"29473d53ec7ec560051ec63dd08b0acbdf4bc484","description":"Core of the A38 hierarchical RBAC library","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-q5YgbdEtIO15+j/PjGfQ9hW5lMyGbQeyLd888nfdv/JVRVczh4xh5XqfucA+rhmQMTcu4drIToWXJhqciBsykw==","shasum":"f93a53533b145589bffc1d1c6e021a2ed4566064","tarball":"https://registry.npmjs.org/@a38/core/-/core-0.0.7.tgz","fileCount":15,"unpackedSize":50198,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDu3APybdwoy+U280m6gtCerf6zaihSdEAl9n1itKpvtAiBvIfjrNsxS5F9AS5mfPQ1nTu3AUPJrXsDVJDc8gUQ7PA=="}]},"_npmUser":{"name":"draconisnoctis","email":"mark.wecke@gmail.com"},"directories":{},"maintainers":[{"name":"draconisnoctis","email":"mark.wecke@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.0.7_1733913317295_0.3014583241496416"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-02T06:57:32.630Z","modified":"2024-12-11T10:35:17.687Z","0.0.1":"2024-07-02T06:57:32.893Z","0.0.2":"2024-07-04T07:45:17.898Z","0.0.3":"2024-08-12T08:00:44.382Z","0.0.4":"2024-08-12T08:04:14.836Z","0.0.5":"2024-12-09T09:15:49.795Z","0.0.6":"2024-12-11T09:24:49.296Z","0.0.7":"2024-12-11T10:35:17.470Z"},"description":"Core of the A38 hierarchical RBAC library","maintainers":[{"name":"draconisnoctis","email":"mark.wecke@gmail.com"}],"readme":"# @a38/core\n\nCore of the A38 hierarchical RBAC library\n\n\n## Installation\n\n```bash\nnpm install @a38/core   # for NPM\nyarn add @a38/core      # for Yarn\npnpm add @a38/core      # for PNPM\n```\n\n## Usage\n\n```typescript\nimport { HRBAC, PermissionManager, ResourceManager, RoleManager } from '@a38/core';\n\nconst roleManager = new RoleManager();\nroleManager.setParents('guest', []); // optional\nroleManager.setParents('user', ['guest']); // role 'user' extends role 'guest'\nroleManager.setParents('admin', ['user']); // role 'admin' extends role 'user'\n\nconst resourceManager = new ResourceManager();\nresourceManager.setParents('dashboard', []); // optional\nresourceManager.setParents('login', []); // optional\nresourceManager.setParents('profile', []); // optional\nresourceManager.setParents('admin', []); // optional\n\nconst permissionManager = new PermissionManager();\npermissionManager.allow('guest', 'dashboard'); // allow 'guest' access to 'dashboard'\npermissionManager.allow('guest', 'login'); // allow 'guest' access to 'dashboard'\n\npermissionManager.allow('user', 'profile'); // allow 'user' access to 'profile'\npermissionManager.deny('user', 'login'); // deny 'user' access to login\n\npermissionManager.allow('admin'); // allow 'admin' access to everything\npermissionManager.deny('admin', 'login'); // deny 'admin' access to login\n\nconst hrbac = new HRBAC(roleManager, resourceManager, permissionManager);\n\nhrbac.isAllowed('guest', 'dashboard'); // -> true\nhrbac.isAllowed('guest', 'login'); // -> true\nhrbac.isAllowed('guest', 'profile'); // -> false\nhrbac.isAllowed('guest', 'admin'); // -> false\n\nhrbac.isAllowed('user', 'login'); // -> false\nhrbac.isAllowed('user', 'profile'); // -> true\n\nhrbac.isAllowed('admin', 'login'); // -> false\nhrbac.isAllowed('admin', 'profile'); // -> true\nhrbac.isAllowed('admin', 'admin'); // -> true\n```\n\n## Docs\n\nSee the [documentation](https://neoskop.github.io/a38/modules/_a38_core.html)\n\n## License\n\n@a38/core is licensed under the MIT License, See the [LICENSE](../../LICENSE) file for more details\n\n## Sponsoring\n\nThe project development and maintenance is sponsored by [Neoskop](https://neoskop.de).","readmeFilename":"README.md"}