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

Offen
#3,443 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
csharp

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C#
Sterne
567
Forks
107
Ø Merge
1 Std. 19 Min.
Gemergte PRs (30 T.)
353

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus fluentcms/FluentCMS

Alle Issues in fluentcms/FluentCMS

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.