浏览代码

Merge pull request #3110 from gravitl/hotfix/release-v0.25.0/rac-auto-disable

fix: user platform role check in rac auto disable
Abhishek K 1 年之前
父节点
当前提交
e3c3a27f80
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      pro/remote_access_client.go

+ 4 - 1
pro/remote_access_client.go

@@ -47,7 +47,10 @@ func racAutoDisableHook() error {
 			continue
 		}
 		for _, client := range clients {
-			if (client.OwnerID == user.UserName) && !user.IsAdmin && !user.IsSuperAdmin && client.Enabled {
+			if (client.OwnerID == user.UserName) &&
+				user.PlatformRoleID != models.SuperAdminRole &&
+				user.PlatformRoleID != models.AdminRole &&
+				client.Enabled {
 				slog.Info(fmt.Sprintf("disabling ext client %s for user %s due to RAC autodisabling", client.ClientID, client.OwnerID))
 				if err := disableExtClient(&client); err != nil {
 					slog.Error("error disabling ext client in RAC autodisable hook", "error", err)