Skip to content

Commit

Permalink
User Settings should only be accessible to individual users or admini…
Browse files Browse the repository at this point in the history
…strators
  • Loading branch information
sbwalker committed Nov 27, 2024
1 parent 77b780d commit d96286d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions Oqtane.Server/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,7 @@ private User Filter(User user)
filtered.DeletedBy = user.DeletedBy;
filtered.DeletedOn = user.DeletedOn;
filtered.IsDeleted = user.IsDeleted;
}

// if authenticated user is accessing their own user account
if (_userPermissions.GetUser(User).UserId == user.UserId)
{
// include all settings
filtered.Settings = user.Settings;
}
else
{
// include only public settings
filtered.Settings = _settings.GetSettings(EntityNames.User, user.UserId)
.Where(item => !item.IsPrivate)
.ToDictionary(setting => setting.SettingName, setting => setting.SettingValue);
filtered.Settings = user.Settings; // include all settings
}
}

Expand Down

0 comments on commit d96286d

Please sign in to comment.