|
@@ -43,13 +43,18 @@ func racAutoDisableHook() error {
|
|
currentTime := time.Now()
|
|
currentTime := time.Now()
|
|
validityDuration := servercfg.GetJwtValidityDuration()
|
|
validityDuration := servercfg.GetJwtValidityDuration()
|
|
for _, user := range users {
|
|
for _, user := range users {
|
|
|
|
+ if user.PlatformRoleID == models.AdminRole ||
|
|
|
|
+ user.PlatformRoleID == models.SuperAdminRole {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
if !currentTime.After(user.LastLoginTime.Add(validityDuration)) {
|
|
if !currentTime.After(user.LastLoginTime.Add(validityDuration)) {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
for _, client := range clients {
|
|
for _, client := range clients {
|
|
|
|
+ if client.RemoteAccessClientID == "" {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
if (client.OwnerID == user.UserName) &&
|
|
if (client.OwnerID == user.UserName) &&
|
|
- user.PlatformRoleID != models.SuperAdminRole &&
|
|
|
|
- user.PlatformRoleID != models.AdminRole &&
|
|
|
|
client.Enabled {
|
|
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 {
|