Commit Graph

11 Commits

Author SHA1 Message Date
marc cc3d65a013 docs: complete function reference, drop unicode punctuation
Documents refresh_hierarchy_cache, is_rule_valid and org_in_scope, and
corrects the get_org_scope scope list which still omitted unattributed
and all.

Replaces em dashes and other typographic unicode with ASCII throughout
the schema comments, the test suite and the documentation. Comments and
prose are ASCII only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-25 07:26:54 +02:00
marc fa7567f5f0 feat(scope): unattributed and all org targets
Adds a first-class org target vocabulary shared by every rule kind: a
specific organization, unattributed (objects whose org is NULL), or all.
A role can now be granted the unassigned pile without a global rule.

- rules.scope gains 'unattributed' and 'all'
- user_rules.org_id accepts NULL to target unattributed objects
- org_in_scope partitions the classes: 'unattributed' matches only a NULL
  target, tree scopes never match one
- has_permission(user, activity, view) capability probe for UI gating
- current_org_filter() parses morbac.org_ids once into org UUIDs plus the
  unattributed-bucket flag (a JSON null element requests it)
- rls_check split by arity so NULL never carries two meanings:
  rls_check(activity, view) for tables with no org column,
  rls_check(activity, view, row_org_id[, row_user_id]) where a NULL
  row_org_id means the record is unattributed
- detect_rule_conflicts is scope-aware, so rules targeting different
  object sets no longer collide

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 22:35:03 +02:00
marc 499df68bf5 fix(rls): not handling global permissions 2026-04-07 01:42:47 +02:00
marc e653b38b88 fix(authorization): system principal regretion 2026-04-06 16:16:29 +02:00
marc 0e3b90af22 feat(system): introduce global rules and system principals for easier system account handling 2026-04-04 09:23:46 +02:00
marc f64cd73159 feat(rules): add rules for users 2026-04-01 23:18:01 +02:00
marc 5ef8bae1b4 feat(all): add scope handling in rules 2026-04-01 23:07:20 +02:00
marc 145f50749b misc(all): cleanup comments, update documentation, tidy up code 2026-03-27 21:56:00 +01:00
marc cba741fd9d feat(rules): add priority field 2026-03-23 01:00:04 +01:00
marc 9e1e448159 feat(src): ensure extension works and tests pass 2026-03-22 15:41:00 +01:00
marc d80b9f387b refacto: add build and cleanup file structure 2026-02-20 01:32:08 +01:00