From 5f09ae7577dd0ab25e164a462bfc00f977dc8664 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Sun, 16 Apr 2023 18:09:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=80=9A=E7=94=A8=E6=A8=A1=E5=9D=97):=20?= =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=85=A5=E8=AE=BF=E9=97=AE=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E6=A8=A1=E5=9D=97url=E6=97=B6=EF=BC=8C=E6=8A=A5=E9=94=99Networ?= =?UTF-8?q?k=20Error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/sdk-parent/frontend/src/utils/permission.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/sdk-parent/frontend/src/utils/permission.js b/framework/sdk-parent/frontend/src/utils/permission.js index f0e093b38e..8f25081fc8 100644 --- a/framework/sdk-parent/frontend/src/utils/permission.js +++ b/framework/sdk-parent/frontend/src/utils/permission.js @@ -3,6 +3,9 @@ import {getCurrentProjectID, getCurrentUser, getCurrentWorkspaceId} from "./toke export function hasPermission(permission) { let user = getCurrentUser(); + if (!user || !user.groups) { + return false; + } let index = user.groups.findIndex(g => g.id === SUPER_GROUP); if (index !== -1) { return true;