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

オープン
#3,443 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
567
フォーク
107
平均マージ
1時間 19分
マージ済み PR(30日)
353

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluentcms/FluentCMS のほかの issue

fluentcms/FluentCMS の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。