Infrastructure high complexity Shared Component backend
1
Dependencies
1
Dependents
3
Entities
1
Integrations

Description

Manages Supabase Row Level Security policies that join through the unit assignment junction table to enforce data access scoping. Generates and applies RLS SQL policies for tables that need unit-level isolation (activities, contacts, reports). Policies are written as Supabase migrations.

Feature: Organizational Hierarchy & Structure Management

rls-policy-manager

Responsibilities

  • Define RLS policies for unit-scoped tables
  • Inject user unit assignments into JWT claims for RLS evaluation
  • Provide SQL migration scripts for policy deployment
  • Test RLS policy effectiveness against simulated roles

Interfaces

applyPolicies(tableName)
buildJwtClaims(userId)
generateMigration(policyDefinitions)
testPolicyForUser(userId, resourceId)
listActivePolicies()

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (3)

Data entities managed by this component

Used Integrations (1)

External integrations and APIs this component relies on

API Contract

View full contract →
REST /api/v1/rls-policies 7 endpoints
GET /api/v1/rls-policies List all RLS policy definitions
GET /api/v1/rls-policies/{policyId} Get a specific RLS policy definition
POST /api/v1/rls-policies Apply RLS policies to a database table
PUT /api/v1/rls-policies/{policyId} Update an existing RLS policy expression
DELETE /api/v1/rls-policies/{policyId} Remove an RLS policy from a table
POST /api/v1/rls-policies/test Test whether a user can access a resource under current RLS policies
+1 more