Row rules on grants: accepted for a type they are not registered for, and ignored beside core permissions

Aperta
#3,443 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Start with RoleService.ValidateGrant, EffectiveGrant.Applies, and EffectivePermissions.Allows, then review spec 4.8 and the tests for GET /permissions and GET /permissions/row-rules. Add coverage for a row rule registered to a different content type, a row rule beside a non-content permission, and grants limited to another site. Done means the behavior follows the spec and each case has a test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:authorization type:bug

Found in the review of #3440 (#3417). Both fail closed or stay within what the caller may hand out; neither is an escalation.

  • A row rule is accepted for a content type it is not registered for. RoleService.ValidateGrant checks rules.Has(name) only. POST /roles with { "permission": "content.person.update", "constraints": { "rowRule": "news" } }, where news is registered for page alone, answers 201. The grant then matches no row (EffectivePermissions.RuleFilter answers null), without a word. The admin can avoid it with typeNames of GET /permissions/row-rules; an API caller gets no FCMS3042.
  • A row rule on a grant of a permission that is not a content permission is accepted and ignored. EffectiveGrant.Applies and EffectivePermissions.Allows do not look at RowRule, so a role with * or users.manage and rowRule: "own-entries" holds the core permissions in full. Spec 4.8 gives a resource-limited * no core permission and says nothing for row rules.
  • No test reads GET /permissions or GET /permissions/row-rules with a grant limited to another site. Every test uses an instance-wide role, so a change of the site passed to the check would pass them all.

Wanted

  • A grant whose row rule is not registered for the content type of its permission is refused with FCMS3042, with a test.
  • A decision, in spec 4.8, on a row rule beside a permission that is not a content permission: refused, or a grant that gives no core permission, with a test.
  • The two tests with a grant limited to another site.

Bundle 27.

Lingua principale
C#
Stelle
567
Fork
107
Merge medio
1h 19m
PR unite (30g)
353

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fluentcms/FluentCMS

Tutte le issue di fluentcms/FluentCMS

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.