polizy

Implement Zanzibar-inspired relationship-based access control in Node.js/TypeScript apps.

7|1|Updated Apr 23, 2025
One-click install
npx skills add https://github.com/bratsos/polizy --skill polizy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: polizy
Source: https://github.com/bratsos/polizy/tree/main/skills/polizy
Command: npx skills add https://github.com/bratsos/polizy --skill polizy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Polizy enables robust, relationship-based access control in Node.js/TypeScript apps, allowing complex permissions to be modeled and checked with type-safe schemas.

Core Features & Use Cases

  • Embeddable library for direct integration into your application.
  • Type-safe schema definitions to model subjects, objects, relations, and actions.
  • Relationship-based access controls for RBAC, ReBAC, and Zanzibar-style models, including group and hierarchy support.
  • Pluggable storage adapters (in-memory and Prisma) for flexible persistence.

Quick Start

Install polizy, define a schema, initialize the AuthSystem with a storage adapter, grant a permission, and perform a permission check.

Frequently Asked Questions about polizy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement relationship-based access control in Node.js?

Relationship-based access control in Node.js can be implemented using a Zanzibar-inspired model with type-safe schema definitions. You define subjects, objects, and relations, then use an AuthSystem to map actions to relations and enforce permission checks.

What is the difference between RBAC and ReBAC for TypeScript applications?

RBAC manages permissions through static role assignments, whereas ReBAC evaluates permissions dynamically based on relationships between entities. In TypeScript, both models can be unified using a Zanzibar-style schema that supports group hierarchies and relationship graphs.

How do I model RBAC and ReBAC permissions with type-safe schemas in TypeScript?

You model RBAC and ReBAC permissions in TypeScript by defining type-safe schemas for subjects, objects, relations, and actions. The schema maps actions to specific relations, allowing the AuthSystem to evaluate complex hierarchical permissions accurately.

Can I use Prisma as a storage adapter for authorization checks?

Yes, Prisma can be used as a storage adapter for authorization checks. The system supports pluggable storage adapters, including Prisma for persistent relational data and an in-memory adapter for testing and local development.

How does a Zanzibar-inspired authorization model handle complex workflows?

A Zanzibar-inspired authorization model handles complex workflows by evaluating relationship tuples rather than static roles. It supports group-based permissions and hierarchical data structures, enabling granular access control across interconnected objects and subjects.

What are the limitations of using an embeddable access control library?

Using an embeddable access control library means authorization logic runs directly within your application process. This simplifies deployment but requires you to manage storage adapter configurations and schema migrations manually as your permission structures scale.