glapi-rls-guide

Official

Ensure GLAPI multi-tenant data isolation.

Authoradteco
Version1.0.0
Installs0

System Documentation

What problem does it solve?

GLAPI's multi-tenant databases need reliable Row Level Security and contextual session variables so that organization-specific queries cannot leak data between tenants, especially when repositories or services might inadvertently use global connections.

Core Features & Use Cases

  • Session Variable Enforcement: Every contextual database connection sets app.current_organization_id before executing queries, ensuring policies compare organization_id values accurately even across inserts, selects, updates, and deletes.
  • Context Module & Middleware: The context helpers and authenticated tRPC middleware create RLS-aware connections, validate organization UUIDs, and release clients safely at the end of each request.
  • Repository Patterns & Troubleshooting: Services and repositories accept a contextual db, follow the ctx.db path, and include debug patterns for diagnosing new row violates row-level security policy errors, illustrating how to add RLS for new tables while keeping migrations aligned.

Quick Start

Use the GLAPI RLS guide to outline the steps for enabling PostgreSQL session variables, RLS policies, and contextual database connections when adding a new multi-tenant table.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: glapi-rls-guide
Download link: https://github.com/adteco/glapi/archive/main.zip#glapi-rls-guide

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.