Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@rljson/access-control

Latest version: v0.1.1

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
npm package Publisher: akraft-carat, behnam.najafloo, gabriel.gatzsche, goeranhegenberg, heller64, inlavigo, jan-balzer, jeany77
0 Stars
0 Forks
4 Versions
JavaScript Repo language

Scan summary

@rljson/access-control was last scanned on 1 Dec 2026 at version 0.1.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions, all published on 1 Dec 2026.
  • Findings: No rules fired in version 0.1.1.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.1 LATEST 1 Dec 2026 No rules fired
0.1.0 1 Dec 2026 No rules fired
0.0.1 1 Dec 2026 No rules fired
0.0.0-stage 1 Dec 2026 Not shown

No rules fired in 0.1.1

Findings

Findings for v0.1.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@rljson/access-control

CI npm

Decides with can() whether a subject may perform an action on an object, and why

Motivation

Applications built on Rljson keep their data on many nodes: a server, desktop clients and browsers, often offline. Who may do what has to be decided the same way on each of them, also without a connection to a server.

  • Rights are data: roles, role assignments and releases are rows that synchronize like every other table
  • The decision is one pure function, can(), that every node runs on its own copy of the rights data
  • Every result carries a reason, so a refusal can be explained to the user and logged with the ref of the rights data it was made with
  • The package has no runtime dependencies; organization, edit history, boards and locks plug in through small interfaces

Installation

pnpm add @rljson/access-control

Usage

import { AccessData, can, type OrgResolver } from '@rljson/access-control';

// The rights data: a role and who holds it for which Scope
const data = new AccessData({
  roles: [
    {
      id: 'editor',
      rights: [{ right: 'document.read' }, { right: 'document.write' }],
    },
  ],
  roleAssignments: [
    {
      id: 'ra-1',
      principalType: 'user',
      principalId: 'ada',
      roleId: 'editor',
      scopeUnit: 'team-a',
    },
  ],
  shares: [
    {
      id: 'share-1',
      objectType: 'document',
      objectId: 'doc-1',
      principalType: 'unit',
      principalId: 'team-b',
      access: 'read',
      mode: 'link',
    },
  ],
});

// The organization: two Units under one Root Unit
const org: OrgResolver = {
  rootOf: () => 'company',
  inScope: (scopeUnit, unitId) => scopeUnit === unitId,
  groupsOf: () => [],
};

const ctx = { data, ref: 'rights-1', time: Date.now(), online: true, org };
const doc = { type: 'document', id: 'doc-1', ownerUnit: 'team-a' };
const ada = { userId: 'ada', unitId: 'team-a', roleId: 'editor' };
const bob = { userId: 'bob', unitId: 'team-b', roleId: 'editor' };

console.log(can(ada, 'document.write', doc, ctx).reason);
console.log(can(bob, 'document.write', doc, ctx).allowed);

It prints:

role editor holds document.write and its Scope team-a contains the Owner Unit team-a
false

bob holds the role editor but has no assignment, so the second call is refused with the rule roleNotAssigned. With an assignment for team-b, bob would read doc-1 through the release share-1, but not write it.

Limitations

  • The organization is not part of this package: Root Units, Scopes, groups and standing releases between Units come from an OrgResolver
  • Boards are not part of it either: State rules and State policies plug in as a WorkflowGuard
  • The lock check leaseLock is a placeholder: a lease of another user blocks changes online; offline it is not enforced
  • can() decides whether a subject may share an object, not whether the target of the release is allowed
  • Rights apply to object types; rights on parts of an object are not supported
  • Rows are passed in plain; the package defines no Rljson table configs yet

Documentation

  • Code guide
  • Test guide
  • Development guide
  • The example world of the tests: test/example-world.ts and the cases played through in test/use-cases.spec.ts

How it works

can(subject, action, object, ctx) returns { allowed, step, rule, reason, ref }.

  • Subject: the signed-in user, the Unit they work in and the role chosen for the session. Rights of several roles do not add up
  • Action: <objectType>.<verb>, e.g. commission.read
  • Object: type, ID, Owner Unit, optional State, lease and flags
  • ctx: the rights data (AccessData), its ref, the time, online or offline, and the resolvers

The checks run in this order; the first refusal wins:

Step Check
action the action is well formed and fits the object type
tenant subject and object lie under the same Root Unit; across Tenants only reading through a link release
stateRules rules that bind everybody, e.g. a read-only State (WorkflowGuard.stateRules)
lock a lease of another user (ctx.lock, default leaseLock)
state what the State allows the subject, moves included (WorkflowGuard.state)
allow the chosen role holds the right, and: a) its Scope contains the Owner Unit, b) a link release names the user, a group of the user or the Unit, c) the condition creator holds, or d) the condition sameGroup holds
deny nothing allows it

The right is always required: releases and conditions only widen the set of objects it reaches. A read release opens read, a write release opens read, write and move; no release opens share, unlock, delete or admin. unlock needs a role without a condition whose Scope contains the Owner Unit.

AccessData indexes the rows once: pass them oldest first, the last row of every ID counts, and withdrawn rows (revoked: true) are dropped.

Performance

test/can-performance.spec.ts measures 100,000 calls in one Tenant with 1,000 Units, 10,000 role assignments, 20 roles with 30 rights each and 100,000 releases. On a developer notebook (Node 22) a call takes about 2 µs and indexing the rights data about 50 ms. The resolvers of the test answer from maps; real resolvers add their own time.

Status

Before 1.0 — the API may change between minor versions.

Contributing

Follow the development guide and the rljson guide.

License

MIT — see LICENSE.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @rljson/access-control

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229