Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add disallow access console option for custom role #4958

Merged
merged 7 commits into from
Dec 1, 2023

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Nov 30, 2023

What type of PR is this?

/area console
/kind feature
/milestone 2.11.x

What this PR does / why we need it:

支持为自定义角色配置 禁止访问 Console 的选项。

Special notes for your reviewer:

测试方式:

  1. 创建一个新角色,勾选禁止访问 Console 的选项,并赋予给某个用户。
  2. 登录之后,尝试访问 /console 观察是否能够正常访问。
  3. 检查个人中心左下角是否有进入 Console 的按钮。
  4. 测试其他未设置这个选项的角色是否正常。

Does this PR introduce a user-facing change?

支持为自定义角色配置 **禁止访问 Console** 的选项。

Signed-off-by: Ryan Wang <i@ryanc.cc>
@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. area/console Issues or PRs related to the Halo Console labels Nov 30, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.11.x milestone Nov 30, 2023
@f2c-ci-robot f2c-ci-robot bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 30, 2023
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (61fe95a) 56.08% compared to head (894cb2d) 56.07%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4958      +/-   ##
============================================
- Coverage     56.08%   56.07%   -0.02%     
+ Complexity     3032     3031       -1     
============================================
  Files           524      524              
  Lines         17663    17663              
  Branches       1319     1319              
============================================
- Hits           9906     9904       -2     
- Misses         7209     7210       +1     
- Partials        548      549       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

关于 Post EditorPost AuthorPost Contributor 角色是否需要设置能否进入 console,这些数据会在每次 Halo 启动的时候初始化,即使设置了也会被覆盖掉。

@ruibaby
Copy link
Member Author

ruibaby commented Nov 30, 2023

关于 Post EditorPost AuthorPost Contributor 角色是否需要设置能否进入 console,这些数据会在每次 Halo 启动的时候初始化,即使设置了也会被覆盖掉。

可以,需不需要加一个 rbac.authorization.halo.run/system-reserved

Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Copy link

f2c-ci-robot bot commented Dec 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2023
Signed-off-by: Ryan Wang <i@ryanc.cc>
@JohnNiang
Copy link
Member

关于 Post EditorPost AuthorPost Contributor 角色是否需要设置能否进入 console,这些数据会在每次 Halo 启动的时候初始化,即使设置了也会被覆盖掉。

可以,需不需要加一个 rbac.authorization.halo.run/system-reserved

建议加上,如果用户想要自定义角色,我将提交另外 PR 再定义和个人中心相关的角色模板。

@ruibaby
Copy link
Member Author

ruibaby commented Dec 1, 2023

关于 Post EditorPost AuthorPost Contributor 角色是否需要设置能否进入 console,这些数据会在每次 Halo 启动的时候初始化,即使设置了也会被覆盖掉。

可以,需不需要加一个 rbac.authorization.halo.run/system-reserved

建议加上,如果用户想要自定义角色,我将提交另外 PR 再定义和个人中心相关的角色模板。

我直接在这个 PR 上加了。

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 05fd5a6 into halo-dev:main Dec 1, 2023
4 checks passed
@ruibaby ruibaby modified the milestones: 2.11.x, 2.11.0 Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/console Issues or PRs related to the Halo Console kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants