Roles of the admin: list, editor and grants from the permission catalogue, with the site's Public role (A-32)

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp

调研方向

Read sections 4.15 and 10.7 of docs/planning/admin-technical-spec.md, then trace the administration assembly and its existing Management API integration. The proposal names /roles, /roles/{id}, GET /permissions, GET /plugins, GET /me/access, and the PUT save flow; use these to locate the relevant entry points and component and API tests. Done means the acceptance cases pass, including grant constraints, site scoping, Public role behavior, and refusal handling.

由索引模型根据 Issue 内容生成。

描述

area:admin type:feature

Problem

Rows 3.16, 4.3 to 4.8 and 8.14 ask that roles and their grants are edited in the admin, the permissions of plugins among them, and row 4.8 that the public access of a site is set there. The Management API has /roles and GET /permissions, and the admin has no page for them.

Proposal

Pages /roles and /roles/{id} in the administration assembly (4.15):

  • The list of the roles the caller may manage: roles.manage for the instance shows every role, and in a site that site's roles. The server answers the whole list, so the page filters what it read.
  • The editor: name, description, site, requireTwoFactor and the grants.
  • A grant picks a permission or a pattern from the catalogue of GET /permissions, grouped by its source (core, content, plugin, settings), with the plugin behind a permission from contributions.permissions of GET /plugins (row 8.14).
  • The editor marks what the caller does not hold, from GET /me/access, and the server stays the authority: its 403 FCMS3103 names the role and is shown on it.
  • A save replaces every grant of the role (PUT). So the editor sends back each constraint of a grant as it read it, resources among them, although it does not edit them: constraints are A-52's, and until then they show read-only on their grant.
  • A role has no ETag. A concurrent change answers FCMS3045; the editor says so and reads the role again without dropping what the user typed.
  • The site's Public role is edited in the same editor, under a notice that its grants are what anyone reads without signing in (row 4.8).
  • Refusals by their code: a built-in role changed or deleted (FCMS3043), a role still held (FCMS3044), the last active Super Admin (FCMS3052).

Acceptance

  • An administrator makes a role with grants of core, of a content type and of a plugin, changes it and deletes it
  • A role with constrained grants is saved with its name changed and keeps every constraint, resources included
  • A grant the caller does not hold is marked, and the server's refusal is shown on the role
  • The Public role of the site is edited under its notice, and what it grants is read without signing in
  • A caller who holds roles.manage in one site sees and changes that site's roles only
  • Component tests cover the catalogue, the round trip of constraints and the refusals; the API tests check the records against the OpenAPI document; an end-to-end case makes a role and gives it to a user

Design: docs/planning/admin-technical-spec.md, sections 4.15 and 10.7 (A-32). Rows 3.16, 4.3 to 4.8, 8.14. Needs A-51. Split when A6 was planned: the constraints of a grant are A-52. Size: M.

主要语言
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 摘要。