# stalniy/casl

CASL is an isomorphic authorization JavaScript library which restricts what resources a given user is allowed to access

Repository: https://github.com/stalniy/casl
Canonical: https://ross.abutalabs.com/products/casl
Homepage: https://casl.js.org/
Language: TypeScript
License: MIT
License Family: permissive
Topics: authorization, permissions, acl, cancan, casl, isomorphic-javascript
Last push: 2026-08-26T00:28:51+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 96, longevity 100
- inputs: {"age_days": 3333, "days_push": 8, "days_rel": 25, "gap_med": 0, "n_releases_24m": 40}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7055, forks 303 (observed 2026-08-28T04:09:55.571321+00:00)

## What it is
CASL is an isomorphic JavaScript authorization library that restricts what resources a user is allowed to access, using declarative rules that scale from simple claims to attribute-based access control. It integrates with major frontend frameworks (React, Angular, Vue) and backend ORMs (Mongoose, Prisma), letting permissions be shared across UI, API services, and database queries.

## Use cases
- check if a user can perform an action on a resource in a Node.js API
- enforce role-based permissions in a React app UI
- filter database queries by user permissions with Mongoose or Prisma
- share authorization rules between frontend and backend
- implement attribute-based access control in a TypeScript app
- serialize permission rules across microservices

## When to choose
- you need fine-grained, declarative authorization in JavaScript/TypeScript
- you want the same permission logic on both client and server
- you need to integrate permissions with ORMs like Mongoose or Prisma
- you want a small, tree-shakable, type-safe access control core

## When to avoid
- you need authentication (identity verification) rather than authorization
- you want a fully managed, centralized policy service outside your app code
- your stack is not JavaScript/TypeScript

## Facets
- artifact type: library
- maturity: stable
- function: authorization, security, middleware
- domain: security, web-development, developer-tools
- platform: browser, cross-platform
- tags: acl, permissions, rbac, abac, isomorphic, typescript, access-control, cancan, nodejs, javascript

## Member repositories
- stalniy/casl (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:55.571321+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:40:30.679143+00:00, confidence not recorded.
  - readme: https://github.com/stalniy/casl (fetched 2026-08-28T04:09:55.571321+00:00, sha 9943b0fe70ce)
  - homepage: https://casl.js.org/ (fetched 2026-08-29T08:36:34.176191+00:00, sha a2a28afca8be)
  - registry_npm: https://registry.npmjs.org/casl (fetched 2026-08-29T08:36:34.185590+00:00, sha 6719b1b517b4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
