mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-20 07:16:06 +08:00
fix: user platform role check in rac auto disable
This commit is contained in:
parent
1ae8900178
commit
f0b5fef587
|
@ -47,7 +47,10 @@ func racAutoDisableHook() error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, client := range clients {
|
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))
|
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 {
|
if err := disableExtClient(&client); err != nil {
|
||||||
slog.Error("error disabling ext client in RAC autodisable hook", "error", err)
|
slog.Error("error disabling ext client in RAC autodisable hook", "error", err)
|
||||||
|
|
Loading…
Reference in a new issue