Skip to content

feat(permissions)!: v0.5.0 — domain-oriented named actions, AND/OR op… - #32

Merged
edimedia merged 1 commit into
mainfrom
develop
Jul 18, 2026
Merged

feat(permissions)!: v0.5.0 — domain-oriented named actions, AND/OR op…#32
edimedia merged 1 commit into
mainfrom
develop

Conversation

@edimedia

Copy link
Copy Markdown
Member

…erators, translatable labels

BREAKING CHANGE: actions are now named strings (create, approve, …) instead of single letters (r, w, d). Permission string format uses '/' (AND) and '|' (OR) separators. Scope ownership is strict.

Core
────

  • actions per scope in PERMISSION_PRESET["actions"] with implies hierarchy and translatable labels via gettext_lazy
  • format: scope:action1/action2 (AND) | scope:action1|action2 (OR)
  • ScopePermission respects / |; ScopeAnyActionPermission always OR
  • ACCESS_SCOPES supports strings or {key, label} dicts with _()
  • strict scope ownership: duplicate → ImproperlyConfigured
  • module self-configures via permissions/permissions.py
  • ACCESS_MANAGER_SCOPE defaults to 'access'

API
───

  • GET /api/access/scopes → [{key, label}] (NEW)
  • GET /api/access/scopes/{scope}/actions → [{key, label}] (NEW)

i18n
────

  • django.po/.mo: French labels for built-in actions & scope

DB
──

  • migration 0010: ArrayField max_length 5→50

Tests & docs
────────────

  • all tests migrated to named actions + labels + scope conflicts
  • docs/permissions.md rewritten, README updated

…erators, translatable labels

BREAKING CHANGE: actions are now named strings (create, approve, …)
instead of single letters (r, w, d). Permission string format uses
'/' (AND) and '|' (OR) separators. Scope ownership is strict.

Core
────
- actions per scope in PERMISSION_PRESET["actions"] with implies
  hierarchy and translatable labels via gettext_lazy
- format: scope:action1/action2 (AND) | scope:action1|action2 (OR)
- ScopePermission respects / |; ScopeAnyActionPermission always OR
- ACCESS_SCOPES supports strings or {key, label} dicts with _()
- strict scope ownership: duplicate → ImproperlyConfigured
- module self-configures via permissions/permissions.py
- ACCESS_MANAGER_SCOPE defaults to 'access'

API
───
- GET /api/access/scopes → [{key, label}] (NEW)
- GET /api/access/scopes/{scope}/actions → [{key, label}] (NEW)

i18n
────
- django.po/.mo: French labels for built-in actions & scope

DB
──
- migration 0010: ArrayField max_length 5→50

Tests & docs
────────────
- all tests migrated to named actions + labels + scope conflicts
- docs/permissions.md rewritten, README updated
@edimedia
edimedia merged commit e7bc9e7 into main Jul 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant