relational-permissions

Configure permission enforcement for nested relational writes on junction and child collections.

Updated May 27, 2026
One-click install
npx skills add https://github.com/Rkaaaa404/cyberhack-SYDT --skill relational-permissions-rkaaaa404
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: relational-permissions
Source: https://github.com/Rkaaaa404/cyberhack-SYDT/tree/main/.agents/skills/relational-permissions
Command: npx skills add https://github.com/Rkaaaa404/cyberhack-SYDT --skill relational-permissions-rkaaaa404

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Nested relational writes (M2M, O2M, M2A) sent to a parent collection normally bypass permission checks on the underlying junction and child tables, letting any user with parent update access freely create or delete related rows. This Skill closes that gap by enforcing a two-layer permission model at every relational level. ## Core Features & Use Cases - Two-Layer Enforcement: Applies a gate check (does the user have any permission for this action on the child collection?) followed by an item-level filter that scopes UPDATE/DELETE via WHERE clauses and INSERT via fields, validation, and presets. - Guided Setup Workflow: Identifies junction/child collections from daas_relations, seeds daas_permissions rows per action, verifies coverage with the audit-relational-permissions endpoint, and enables enforcement via ENFORCE_RELATIONAL_PERMISSIONS. - Filter Rule Guardrails: Documents which JSONB filter patterns are supported on child mutations (scalar operators, _in, _and/_or, $CURRENT_USER) and which silently fail (_has, dot-notation, _some/_none), preventing accidental over-permissive access. - Use Case: A PATCH to cmp_catalogues with nested catalogue_services create/delete blocks is rejected with 403 unless the user's policy grants create/delete on cmp_catalogue_services, scoped to rows they own. ## Quick Start Set up relational permissions so that nested writes to the catalogue_services junction table require explicit create and delete permissions scoped to the current user.

Frequently Asked Questions about relational-permissions

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

FAQPage Schema
How do I enforce permissions on nested relational writes?▼

Create daas_permissions rows for each action (create, update, delete) on the junction or child collection under the appropriate policy, then set ENFORCE_RELATIONAL_PERMISSIONS=true. The platform applies a gate check plus an item-level filter on every nested mutation.

Why are my nested mutations silently ignored or unchecked?▼

Without relational permission enforcement, writes to junction tables execute with no permission check once the parent update passes. In warn mode (the default), violations are logged but not blocked, so switch the enforcement flag to true only after seeding all permissions.

Which filter operators work on child collection permissions?▼

Supported patterns include scalar operators, _in/_nin, _null/_nnull, string operators, _between, _regex, scalar-only _and/_or, and $CURRENT_USER/$CURRENT_POLICIES. Relational patterns like _has, dot-notation, and _some/_none are silently ignored and widen access.

How do I find the junction table for an M2M relation?▼

Query daas_relations filtering by the parent collection in one_collection and read the many_collection value where junction_field is set. For M2A relations, also check each target listed in one_allowed_collections.

Can relational writes mutate grandchildren in one request?▼

No. Relational writes are processed only one level deep, so nested relational fields inside a child payload are ignored. Issue separate API calls for each deeper level you need to mutate.

How do I make a junction collection read-only for a role?▼

Simply do not create any create, update, or delete permission rows for that junction collection under the role's policy. The gate check will then reject all mutation attempts on the relation.