From f0b5fef58740b2c79ed5f06e0d7c2236a083e945 Mon Sep 17 00:00:00 2001 From: the_aceix Date: Fri, 6 Sep 2024 17:42:35 +0000 Subject: [PATCH] fix: user platform role check in rac auto disable --- pro/remote_access_client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pro/remote_access_client.go b/pro/remote_access_client.go index 5ec6708a..c46115bc 100644 --- a/pro/remote_access_client.go +++ b/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)