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

用户角色标识无法正常显示角色名称 #3257

Closed
ruibaby opened this issue Feb 8, 2023 · 2 comments · Fixed by halo-dev/console#847 or #3280
Closed

用户角色标识无法正常显示角色名称 #3257

ruibaby opened this issue Feb 8, 2023 · 2 comments · Fixed by halo-dev/console#847 or #3280
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/improvement Categorizes issue or PR as related to a improvement. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Milestone

Comments

@ruibaby
Copy link
Member

ruibaby commented Feb 8, 2023

是什么版本出现了此问题?

2.2.0

使用的什么数据库?

PostgreSQL

使用的哪种方式部署?

Docker Compose

在线站点地址

https://ryanc.cc

发生了什么?

如图:

image

这里应该是选用了 metadata.name 而不是显示名称字段。

后端接口:

Request URL:https://ryanc.cc/api/v1alpha1/users?page=1&size=20

Response:

{
  "page": 1,
  "size": 20,
  "total": 3,
  "items": [
    {
      "spec": {
        "displayName": "Anonymous User",
        "email": "[email protected]",
        "disabled": true
      },
      "apiVersion": "v1alpha1",
      "kind": "User",
      "metadata": {
        "finalizers": [
          "user-protection"
        ],
        "name": "anonymousUser",
        "annotations": {
          "rbac.authorization.halo.run/role-names": "[\"role-QUFCB\"]"
        },
        "version": 6,
        "creationTimestamp": "2023-02-06T14:01:34.097399356Z"
      }
    },
    {
      "spec": {
        "displayName": "Demo",
        "avatar": "",
        "email": "[email protected]",
        "phone": "",
        "password": "",
        "bio": "",
        "disabled": false,
        "loginHistoryLimit": 0
      },
      "status": {
        "permalink": "https://ryanc.cc/authors/demouser"
      },
      "apiVersion": "v1alpha1",
      "kind": "User",
      "metadata": {
        "finalizers": [
          "user-protection"
        ],
        "name": "demouser",
        "annotations": {
          "rbac.authorization.halo.run/role-names": "[\"role-QUFCB\"]"
        },
        "version": 3,
        "creationTimestamp": "2023-02-08T13:29:47.792541497Z"
      }
    },
    {
      "spec": {
        "displayName": "Ryan Wang",
        "avatar": "https://ryanc.cc/upload/2022/05/github-avatar.png",
        "email": "[email protected]",
        "password": "{bcrypt}$2a$10$YnGe5PSr1vLCAr/gpH.s.e.NHq97vdN.QiRbibF6VQlUQNs7TohgG",
        "bio": "Hello Halo",
        "registeredAt": "2023-02-06T14:01:34.190012807Z",
        "twoFactorAuthEnabled": false,
        "disabled": false
      },
      "status": {
        "permalink": "https://ryanc.cc/authors/ryanwang"
      },
      "apiVersion": "v1alpha1",
      "kind": "User",
      "metadata": {
        "finalizers": [
          "user-protection"
        ],
        "name": "ryanwang",
        "annotations": {
          "rbac.authorization.halo.run/role-names": "[\"super-role\"]"
        },
        "version": 7,
        "creationTimestamp": "2023-02-06T14:01:34.317446680Z"
      }
    }
  ],
  "first": true,
  "last": true,
  "hasNext": false,
  "hasPrevious": false,
  "totalPages": 1
}

/kind improvement
/area core
/area console
/priority critical-urgent
/milestone 2.3.x

相关日志输出

No response

附加信息

No response

@f2c-ci-robot f2c-ci-robot bot added the kind/improvement Categorizes issue or PR as related to a improvement. label Feb 8, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.3.x milestone Feb 8, 2023
@f2c-ci-robot f2c-ci-robot bot added area/core Issues or PRs related to the Halo Core area/console Issues or PRs related to the Halo Console priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Feb 8, 2023
f2c-ci-robot bot pushed a commit that referenced this issue Feb 10, 2023
#### What type of PR is this?

/kind improvement

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

为系统初始化的角色添加显示名称

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


Fixes #3257

#### Screenshots:

<img width="1668" alt="image" src="https://user-images.githubusercontent.com/21301288/218020794-696420c4-69bb-4422-9409-482bb2aff708.png">


#### Special notes for your reviewer:

see 

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

```release-note
为系统初始化的角色添加显示名称
```
@ruibaby ruibaby modified the milestones: 2.3.x, 2.3.0 Feb 10, 2023
@lixuejun725
Copy link

这里有时角色不显示,但切换角色之后会刷新

@JohnNiang
Copy link
Member

Hi @lixuejun725, please see #2882 for more.

f2c-ci-robot bot pushed a commit to halo-dev/console that referenced this issue Feb 15, 2023
#### What type of PR is this?

/kind improvement

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

为系统初始化的角色添加显示名称

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

Fixes halo-dev/halo#3257

#### Screenshots:

<img width="1668" alt="image" src="https://user-images.githubusercontent.com/21301288/218020794-696420c4-69bb-4422-9409-482bb2aff708.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到:halo-dev/halo#3280
2. 检查 Console 端显示的系统角色是否正常。
3. 新建若干自定义角色,检查名称是否正常。

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

```release-note
优化 Console 端用户角色标识的显示名称。
```
JohnNiang pushed a commit to JohnNiang/halo that referenced this issue Mar 2, 2023
#### What type of PR is this?

/kind improvement

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

为系统初始化的角色添加显示名称

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

Fixes halo-dev#3257

#### Screenshots:

<img width="1668" alt="image" src="https://user-images.githubusercontent.com/21301288/218020794-696420c4-69bb-4422-9409-482bb2aff708.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到:halo-dev#3280
2. 检查 Console 端显示的系统角色是否正常。
3. 新建若干自定义角色,检查名称是否正常。

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

```release-note
优化 Console 端用户角色标识的显示名称。
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/improvement Categorizes issue or PR as related to a improvement. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
3 participants