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

@telamonjs/permissions

Latest version: v1.1.0

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: mtullyoc
0 Stars
0 Forks
5 Versions
390 Downloads
TypeScript Repo language

Scan summary

@telamonjs/permissions was last scanned on 23 Nov 2026 at version 1.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 5 versions, all published within 5 days (19–23 Nov 2026).
  • Findings: No rules fired in version 1.1.0.
  • Downloads: 390 downloads.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.1.0 LATEST 23 Nov 2026 No rules fired
1.0.2 23 Nov 2026 No rules fired
1.0.1 19 Nov 2026 No rules fired
1.0.0 19 Nov 2026 Not shown
0.0.0-stage 19 Nov 2026 Not shown

No rules fired in 1.1.0

Findings

Findings for v1.1.0. 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 1.1.0; other versions have their own rules, not their own score.

README

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

@telamonjs/permissions

RBAC materialized into the JWT. Permissions are resolved once at login and carried in the token, so every check is a pure array lookup on the claims: no database query per request. The core is client-safe (fine inside a React component); @telamonjs/permissions/nest adds a @Permissions(...) decorator and a guard that reads the same array off request.user.

Zero runtime dependencies · dual ESM/CJS · sideEffects: false.

Install

pnpm add @telamonjs/permissions
Peer dependency Range
@nestjs/common (optional) ^10.0.0 \|\| ^11.0.0
@nestjs/core (optional) ^10.0.0 \|\| ^11.0.0

The Nest peers are only needed for @telamonjs/permissions/nest.

Client-safe checker, once per app

import { createPermissionChecker } from '@telamonjs/permissions'

export const { can, canAny, canAll, hasBypassRole } =
  createPermissionChecker({ bypassRoles: ['superadmin'] })

can(user, 'users.write')                 // single permission
canAny(user, ['a.read', 'b.read'])       // OR
canAll(user, ['a.read', 'a.write'])      // AND

user is anything shaped like UserWithPermissions ({ id, role?, roles?, permissions? }). The AuthUser from @telamonjs/auth satisfies it by design: a duck-typed contract pinned by a test, with no dependency between the packages.

NestJS guard and decorator

import { createPermissionsGuard, Permissions } from '@telamonjs/permissions/nest'

export const PermissionsGuard = createPermissionsGuard() // bypassRoles defaults to ['superadmin']

@Get('admin')
@UseGuards(JwtAuthGuard, PermissionsGuard)   // auth first: it sets request.user
@Permissions('admin.read', 'admin.write')    // string clauses are OR
getAdminData() {}

@Permissions(['admin.read', 'admin.write'])  // an inner array is AND

The guard delegates to the same checker, so client and server checks can't drift. A request with no request.user gets a 401; a user without the permission gets a 403 with the generic message Insufficient permissions (the required codes are never sent to the client).

By default a route without @Permissions is open. Opt into deny-by-default with failClosed; then only routes marked @Public() skip the decorator:

import { createPermissionsGuard, Public } from '@telamonjs/permissions/nest'

export const PermissionsGuard = createPermissionsGuard({ failClosed: true })

@Public()          // same metadata key as Public() from @telamonjs/auth/nest
@Get('health')
health() {}

Two more options:

  • onDenied({ user, required, request }) is called right before every 403 (log the denial there). The client still gets the generic message.
  • createException(status, message) builds the 401/403. Set it while the package is linked (link:/file:), so the guard throws the host's @nestjs/common classes instead of its own copy's, which the host's filters would turn into a 500:
import { ForbiddenException, UnauthorizedException } from '@nestjs/common'

export const PermissionsGuard = createPermissionsGuard({
  onDenied: ({ user, required }) => logger.warn('permission denied', { userId: user?.id, required }),
  createException: (status, message) =>
    status === 401 ? new UnauthorizedException(message) : new ForbiddenException(message),
})

Role helpers

isAdminRole(role, roles)             // 'admin' | 'superadmin'
isSuperAdminRole(role, roles)        // privilege gates only
hasGlobalDataVisibility(role, roles) // data scoping only: don't mix the two
getPrimaryRole(role, roles)

Multi-role first: roles[] wins everywhere, and the singular role is the fallback.

Reference Prisma schema

A starting-point schema ships with the package. Copy it into your schema.prisma and adapt it: it is a reference, not a managed migration.

cat node_modules/@telamonjs/permissions/src/prisma/schema.prisma

The model and enum names are in Portuguese (pt-BR): Papel (role), UsuarioPapel (user ↔ role), Permissao (permission), PermissaoPapel (role ↔ permission), PermissaoUsuario (per-user grant/revoke overrides) and LogPermissao (audit log), plus the enums AcaoPermissao, TipoOverride and ResultadoPermissao. Rename them freely in your copy; the checker only reads the permissions[] claim.

This package checks permissions. Resolving them at login (database → permissions[] claim) is your app's job, typically in your NextAuth authorize() or API login, feeding @telamonjs/auth's session claims.

Entry points

  • @telamonjs/permissions
  • @telamonjs/permissions/nest
  • @telamonjs/permissions/prisma/schema.prisma (file ./src/prisma/schema.prisma)

Every name each entry point exports, runtime and types: Public API index.

Full docs

Full docs → the permissions page of the docs site (MDX sources, readable on GitHub).

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 @telamonjs/permissions

References

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

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 (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Copy of Template Design OX Blog (2)
Research

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

Frame 2085668439 (1)
Group 1261154229