From f172cb2164671b0bcab2cf686091be60fded3cd2 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Mon, 18 Jul 2022 14:13:00 +0800 Subject: [PATCH] fix: update user's scope system role check For all user, check system role by keystone system role api, remove the special username admin check Change-Id: I46b58b1061bd2914933f5eb2950f3e34ee34c437 --- src/stores/root.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/stores/root.js b/src/stores/root.js index 158a2c5a..0a608d09 100644 --- a/src/stores/root.js +++ b/src/stores/root.js @@ -110,11 +110,8 @@ export class RootStore { } async getUserSystemRoles(user) { - // only user admin or system roles has admin/reader can go to administrator - const { id, name } = user; - if (name === 'admin') { - return true; - } + // only scope system roles has admin/reader can go to administrator + const { id } = user; try { const result = await client.keystone.systemUsers.roles.list(id); const { roles = [] } = result;