Skip to content

docs(plan): GAP A capability taxonomy + 3-state permission model - #490

Merged
rpgmem merged 5 commits into
developfrom
claude/gap-a-capability-taxonomy
Jun 4, 2026
Merged

docs(plan): GAP A capability taxonomy + 3-state permission model#490
rpgmem merged 5 commits into
developfrom
claude/gap-a-capability-taxonomy

Conversation

@rpgmem

@rpgmem rpgmem commented Jun 4, 2026

Copy link
Copy Markdown
Owner

O que

Documento de planejamento (só doc, para revisão) do GAP A da issue #488: padronização da taxonomia de capabilities + modelo de permissão de 3 estados (não vê / só vê / vê e edita, com admin WP por cima).

Arquivo: docs/plans/gap-a-capability-taxonomy.md.

Decisões já travadas com o mantenedor

  • Padrão de nomes ratificado: ffc_<ação>_[own_]<domínio>[_<qualificador>] (view/manage/export/import/edit/delete + especiais).
  • Migração completa junto: os 10 renames de caps existentes entram no mesmo PR de implementação, via migração.
  • Domínio único appointments para o auto-agendamento (o eixo público/privado é o flag scheduling_visibility por calendário, não capability).
  • "View em todas": 8 novas caps de view → total 34.
  • Split por visibilidade (manage público vs privado) adiado → issue Auto-agendamento: delegação de gestão por visibilidade (calendários públicos vs privados) #489.

Por que doc primeiro

A pedido do mantenedor: revisar o plano antes de escrever código (PR de implementação é grande e tem breaking-change pelos renames).

Escopo da implementação (resumo, ver doc)

  1. Padrão no CLAUDE.md + registro/catálogo + migração de dados (user_meta + roles) — ⚠ rename Claude/fix migration cleanup xl j4 p #2 reverte a migração 4.5.0 (nova option-key).
  2. Gates 3-estados: Certificates, Custom fields, Recruitment settings.
  3. Roles (ffc_operator ganha as view novas; defs migradas).
  4. Testes + CHANGELOG com banner ⚠ breaking-change.

Relacionado

#488 (gaps + padrão) · #489 (visibilidade) · #482 / #486 / #487.


Este PR não deve auto-mergear — é para revisão do plano.

https://claude.ai/code/session_015oyFHBoKYyRez9F3ARZjvD


Generated by Claude Code

Planning document for review (refs #488, #489). Captures the ratified
capability naming standard, the not-see/see/see-and-edit model, the full
rename map (single 'appointments' domain), the eight new view caps, and the
per-surface 3-state gates for certificates, custom fields and recruitment
settings.

https://claude.ai/code/session_015oyFHBoKYyRez9F3ARZjvD
claude added 4 commits June 4, 2026 20:29
Establishes the plugin-wide capability naming standard (ffc_<action>_[own_]
<domain>[_<qualifier>]) and the 3-state permission model, per #488.

- Rename 10 caps to the standard (single 'appointments' domain). The
  ffc_view_self_scheduling -> ffc_view_own_appointments pair reverses the
  4.5.0 rename migration, so it ships under a new option flag.
- Add 8 read-only 'view' caps (the *só vê* tier): ffc_view_certificates,
  _appointments, _audiences, _reregistration, _custom_fields, _settings,
  _recruitment_settings, _recruitment_reasons. Total 26 -> 34 caps.
- CapabilityCatalog updated (invariant all_slugs() == get_all_capabilities()
  preserved); CLAUDE.md documents the standard + gate rules.
- One-shot migration (CapabilityManager::migrate_taxonomy_renames +
  Loader::ensure_taxonomy_renamed) rewrites grants on every user and role;
  admin caps version bumped v2 -> v3 so the new view caps reach the
  administrator role. ffc_operator gains the admin view caps.
- phpcs custom_capabilities allowlist updated.

Breaking: external integrations referencing the old slugs must update.

https://claude.ai/code/session_015oyFHBoKYyRez9F3ARZjvD
- phpcbf realignment of the catalog arrays after the slug renames (the
  WPCS 'Array double arrow not aligned' failure on the previous push).
- Each FFC manage role now also carries its matching view cap so the admin
  menu/tab (gated by a single view-cap string) stays visible to managers;
  inline write gates still require the manage cap.

https://claude.ai/code/session_015oyFHBoKYyRez9F3ARZjvD
Certificates:
- Submissions menu + Certificates Dashboard gated by ffc_view_certificates;
  trash/restore/delete (single + bulk + AJAX) require ffc_manage_certificates;
  the per-record Edit link requires ffc_edit_certificates. Row/bulk write
  actions are hidden from read-only viewers.

Custom fields:
- Audience custom-field save/delete/replicate AJAX gated by
  ffc_manage_custom_fields; the editor section renders read-only (no add/save
  controls) for ffc_view_custom_fields-only users.

Recruitment settings:
- Settings tab governed by ffc_view_recruitment_settings (see, read-only) and
  ffc_manage_recruitment_settings (edit); the latter is also wired as the
  options.php capability for the recruitment option group, so a Recruitment
  Manager operates the module while only a Recruitment Admin configures it.
  The tab is hidden without the view cap and the form is a disabled fieldset
  (no submit) for read-only viewers.

Roles: ffc_recruitment_admin gains the recruitment view caps; manage roles
carry their matching view cap so menus/tabs stay visible.

Tests: taxonomy_cap_renames map + migrate_taxonomy_renames coverage.
CHANGELOG: breaking-change banner for the renames + the newly-enforced caps.

https://claude.ai/code/session_015oyFHBoKYyRez9F3ARZjvD
The dashboard CAPABILITY const moved from edit_others_posts to
ffc_view_certificates (3-state gating); the test's hardcoded expectations
follow.

https://claude.ai/code/session_015oyFHBoKYyRez9F3ARZjvD
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.

2 participants