@page "/Settings/Library" @using LANCommander.Server.Settings @using Microsoft.Extensions.Options @inject IMessageService MessageService @inject ILogger Logger @inject IOptions Settings @inject SettingsProvider SettingsProvider @attribute [Authorize(Roles = RoleService.AdministratorRoleName)]
Allows users to manage the games they see in their library. This also enables the Depot! Restricts the games that users can see in their library and the depot based on their role. Visit Settings / Roles to assign collections to roles.
@code { void Save() { try { SettingsProvider.Update(s => { s.Server.Library = Settings.Value.Server.Library; s.Server.Roles.RestrictGamesByCollection = Settings.Value.Server.Roles.RestrictGamesByCollection; }); MessageService.Success("Settings saved!"); } catch (Exception ex) { MessageService.Error("An unknown error occurred."); Logger.LogError(ex, "An unknown error occurred."); } } }