Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

feat: refining the logic of user roles #749

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Dec 6, 2022

What type of PR is this?

/kind improvement
/milestone 2.0.1

What this PR does / why we need it:

完善用户角色的相关逻辑。适配 halo-dev/halo#2865

  1. 支持标识是否是系统保留角色。
  2. 根据是否是系统保留角色,禁用修改和删除的操作。
  3. 支持判断是否是超级管理员,如果是,默认勾选所有权限。
  4. 优化 包含 N 个权限 文案的逻辑,超级管理员为 包含所有权限
  5. 优化 基于此角色创建 的逻辑,判断是否为超级管理员,如果是,需要设置所有角色模板到创建表单。

Which issue(s) this PR fixes:

Fixes halo-dev/halo#2844

Screenshots:

image

image

Special notes for your reviewer:

测试方式:

  1. Halo 需要切换到 Add forgotten label for system-reserved roles halo#2865 分支。
  2. 测试角色相关的所有功能。

Does this PR introduce a user-facing change?

完善 Console 端用户角色的相关逻辑

@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. kind/improvement Categorizes issue or PR as related to a improvement. labels Dec 6, 2022
@f2c-ci-robot f2c-ci-robot bot added this to the 2.0.1 milestone Dec 6, 2022
@vercel
Copy link

vercel bot commented Dec 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ui ✅ Ready (Inspect) Visit Preview Dec 7, 2022 at 3:27AM (UTC)

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.

It works very well.

image

/approve

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 7, 2022

[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 7, 2022
@JohnNiang JohnNiang added kind/bug Categorizes issue or PR as related to a bug. and removed kind/improvement Categorizes issue or PR as related to a improvement. labels Dec 7, 2022
@JohnNiang
Copy link
Member

/cherry-pick release-2.0

@halo-dev-bot
Copy link

@JohnNiang: once the present PR merges, I will cherry-pick it on top of release-2.0 in a new PR and assign it to you.

In response to this:

/cherry-pick release-2.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@guqing guqing 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 7, 2022
@f2c-ci-robot f2c-ci-robot bot merged commit c70b069 into halo-dev:main Dec 7, 2022
@halo-dev-bot
Copy link

@JohnNiang: new pull request created: #756

In response to this:

/cherry-pick release-2.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

f2c-ci-robot bot pushed a commit that referenced this pull request Dec 7, 2022
This is an automated cherry-pick of #749

/assign JohnNiang

```release-note
完善 Console 端用户角色的相关逻辑
```
@ruibaby ruibaby deleted the feat/refine-role branch December 7, 2022 06:44
JohnNiang pushed a commit to JohnNiang/halo that referenced this pull request Mar 2, 2023
#### What type of PR is this?

/kind improvement
/milestone 2.0.1

#### What this PR does / why we need it:

完善用户角色的相关逻辑。适配 halo-dev#2865

1. 支持标识是否是系统保留角色。
2. 根据是否是系统保留角色,禁用修改和删除的操作。
3. 支持判断是否是超级管理员,如果是,默认勾选所有权限。
4. 优化 `包含 N 个权限` 文案的逻辑,超级管理员为 `包含所有权限`。
5. 优化 `基于此角色创建` 的逻辑,判断是否为超级管理员,如果是,需要设置所有角色模板到创建表单。

#### Which issue(s) this PR fixes:

Fixes halo-dev#2844

#### Screenshots:

<img width="1663" alt="image" src="https://user-images.githubusercontent.com/21301288/205965292-b8f8e556-e06b-422b-b0be-8d87a68f18be.png">
<img width="1661" alt="image" src="https://user-images.githubusercontent.com/21301288/205965333-1491c023-6726-4cdd-b970-d868a30f3296.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev#2865 分支。
2. 测试角色相关的所有功能。

#### Does this PR introduce a user-facing change?


```release-note
完善 Console 端用户角色的相关逻辑
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. 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.

我创建的一个role不应该被打上 系统保留的标签
4 participants