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

未关闭
#3,443 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 分钟
30 天内合并 PR
353

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fluentcms/FluentCMS 的其他 Issue

查看 fluentcms/FluentCMS 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。