Semaphor

Security Definitions

Create and manage reusable security policy templates

Security definitions are reusable policy templates that describe what security rules to apply to a connection. Each definition can include any combination of:

  • Connection-level security (CLS) -- route users to different databases or file paths
  • Schema-level security (SLS) -- restrict which schemas a user can query
  • Row-level security (RLS) -- inject WHERE-clause filters so users only see authorized rows

Once created, a definition can be assigned to one or more actors (tenants, tenant users, or organization users) with concrete parameter values.

Persisted RLS definitions declare each parameter once at definition scope with one source: FIXED, ASSIGNMENT, or TOKEN. See How Row-Level Security Works for the activation and precedence model.

Endpoints

MethodEndpointDescription
GETList definitionsList all definitions in a project
POSTCreate a definitionCreate a new definition for a connection
GETGet a definitionRetrieve a single definition
PATCHUpdate a definitionUpdate a definition's name or configuration
DELETEDelete a definitionDelete a definition (must have no assignments)
POSTValidate a new definitionValidate a create candidate without saving
POSTValidate a definition updateValidate an update candidate without saving

On this page