fix(auth): Fixed an issue where refreshing the page as a power user would stop the application from loading #5242

This commit is contained in:
tidusjar 2025-07-12 22:25:31 +01:00
commit cee40146ee

View file

@ -40,7 +40,6 @@ namespace Ombi.Controllers.V1
/// <summary> /// <summary>
/// The Settings Controller /// The Settings Controller
/// </summary> /// </summary>
[Admin]
[ApiV1] [ApiV1]
[Produces("application/json")] [Produces("application/json")]
[ApiController] [ApiController]
@ -78,6 +77,7 @@ namespace Ombi.Controllers.V1
/// Gets the Ombi settings. /// Gets the Ombi settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("ombi")] [HttpGet("ombi")]
public async Task<OmbiSettings> OmbiSettings() public async Task<OmbiSettings> OmbiSettings()
{ {
@ -110,6 +110,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="ombi">The ombi.</param> /// <param name="ombi">The ombi.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("ombi")] [HttpPost("ombi")]
public async Task<bool> OmbiSettings([FromBody]OmbiSettings ombi) public async Task<bool> OmbiSettings([FromBody]OmbiSettings ombi)
{ {
@ -145,6 +146,7 @@ namespace Ombi.Controllers.V1
return model; return model;
} }
[Admin]
[HttpPost("ombi/resetApi")] [HttpPost("ombi/resetApi")]
public async Task<string> ResetApiKey() public async Task<string> ResetApiKey()
{ {
@ -159,6 +161,7 @@ namespace Ombi.Controllers.V1
/// Gets the Plex Settings. /// Gets the Plex Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("plex")] [HttpGet("plex")]
public async Task<PlexSettings> PlexSettings() public async Task<PlexSettings> PlexSettings()
{ {
@ -185,6 +188,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="plex">The plex.</param> /// <param name="plex">The plex.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("plex")] [HttpPost("plex")]
public async Task<bool> PlexSettings([FromBody]PlexSettings plex) public async Task<bool> PlexSettings([FromBody]PlexSettings plex)
{ {
@ -207,6 +211,7 @@ namespace Ombi.Controllers.V1
/// Gets the Emby Settings. /// Gets the Emby Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("emby")] [HttpGet("emby")]
public async Task<EmbySettings> EmbySettings() public async Task<EmbySettings> EmbySettings()
{ {
@ -218,6 +223,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="emby">The emby.</param> /// <param name="emby">The emby.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("emby")] [HttpPost("emby")]
public async Task<bool> EmbySettings([FromBody]EmbySettings emby) public async Task<bool> EmbySettings([FromBody]EmbySettings emby)
{ {
@ -243,6 +249,7 @@ namespace Ombi.Controllers.V1
/// Gets the Jellyfin Settings. /// Gets the Jellyfin Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("jellyfin")] [HttpGet("jellyfin")]
public async Task<JellyfinSettings> JellyfinSettings() public async Task<JellyfinSettings> JellyfinSettings()
{ {
@ -254,6 +261,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="jellyfin">The jellyfin.</param> /// <param name="jellyfin">The jellyfin.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("jellyfin")] [HttpPost("jellyfin")]
public async Task<bool> JellyfinSettings([FromBody]JellyfinSettings jellyfin) public async Task<bool> JellyfinSettings([FromBody]JellyfinSettings jellyfin)
{ {
@ -291,6 +299,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("landingpage")] [HttpPost("landingpage")]
public async Task<bool> LandingPageSettings([FromBody]LandingPageSettings settings) public async Task<bool> LandingPageSettings([FromBody]LandingPageSettings settings)
{ {
@ -326,6 +335,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("customization")] [HttpPost("customization")]
public async Task<bool> CustomizationSettings([FromBody]CustomizationSettings settings) public async Task<bool> CustomizationSettings([FromBody]CustomizationSettings settings)
{ {
@ -344,6 +354,7 @@ namespace Ombi.Controllers.V1
/// Get's the preset themes available /// Get's the preset themes available
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("themes")] [HttpGet("themes")]
public async Task<IEnumerable<PresetThemeViewModel>> GetThemes() public async Task<IEnumerable<PresetThemeViewModel>> GetThemes()
{ {
@ -389,6 +400,7 @@ namespace Ombi.Controllers.V1
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[HttpPost("sonarr")] [HttpPost("sonarr")]
[Admin]
public async Task<bool> SonarrSettings([FromBody]SonarrSettings settings) public async Task<bool> SonarrSettings([FromBody]SonarrSettings settings)
{ {
var result = await Save(settings); var result = await Save(settings);
@ -418,6 +430,7 @@ namespace Ombi.Controllers.V1
/// Gets the Lidarr Settings. /// Gets the Lidarr Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("lidarr")] [HttpGet("lidarr")]
public async Task<LidarrSettings> LidarrSettings() public async Task<LidarrSettings> LidarrSettings()
{ {
@ -441,6 +454,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("lidarr")] [HttpPost("lidarr")]
public async Task<bool> LidarrSettings([FromBody]LidarrSettings settings) public async Task<bool> LidarrSettings([FromBody]LidarrSettings settings)
{ {
@ -457,6 +471,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("authentication")] [HttpPost("authentication")]
public async Task<bool> AuthenticationsSettings([FromBody]AuthenticationSettings settings) public async Task<bool> AuthenticationsSettings([FromBody]AuthenticationSettings settings)
{ {
@ -479,6 +494,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("radarr")] [HttpPost("radarr")]
public async Task<bool> RadarrSettings([FromBody]RadarrCombinedModel settings) public async Task<bool> RadarrSettings([FromBody]RadarrCombinedModel settings)
{ {
@ -500,6 +516,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("Update")] [HttpPost("Update")]
public async Task<bool> UpdateSettings([FromBody]UpdateSettings settings) public async Task<bool> UpdateSettings([FromBody]UpdateSettings settings)
{ {
@ -510,6 +527,7 @@ namespace Ombi.Controllers.V1
/// Gets the UserManagement Settings. /// Gets the UserManagement Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("UserManagement")] [HttpGet("UserManagement")]
public async Task<UserManagementSettings> UserManagementSettings() public async Task<UserManagementSettings> UserManagementSettings()
{ {
@ -521,6 +539,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("UserManagement")] [HttpPost("UserManagement")]
public async Task<bool> UserManagementSettings([FromBody]UserManagementSettings settings) public async Task<bool> UserManagementSettings([FromBody]UserManagementSettings settings)
{ {
@ -531,6 +550,7 @@ namespace Ombi.Controllers.V1
/// Gets the Update Settings. /// Gets the Update Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("Update")] [HttpGet("Update")]
public async Task<UpdateSettings> UpdateSettings() public async Task<UpdateSettings> UpdateSettings()
{ {
@ -543,6 +563,7 @@ namespace Ombi.Controllers.V1
/// Gets the CouchPotatoSettings Settings. /// Gets the CouchPotatoSettings Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("CouchPotato")] [HttpGet("CouchPotato")]
public async Task<CouchPotatoSettings> CouchPotatoSettings() public async Task<CouchPotatoSettings> CouchPotatoSettings()
{ {
@ -554,6 +575,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("CouchPotato")] [HttpPost("CouchPotato")]
public async Task<bool> CouchPotatoSettings([FromBody]CouchPotatoSettings settings) public async Task<bool> CouchPotatoSettings([FromBody]CouchPotatoSettings settings)
{ {
@ -564,6 +586,7 @@ namespace Ombi.Controllers.V1
/// Gets the DogNzbSettings Settings. /// Gets the DogNzbSettings Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("DogNzb")] [HttpGet("DogNzb")]
public async Task<DogNzbSettings> DogNzbSettings() public async Task<DogNzbSettings> DogNzbSettings()
{ {
@ -575,6 +598,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("DogNzb")] [HttpPost("DogNzb")]
public async Task<bool> DogNzbSettings([FromBody]DogNzbSettings settings) public async Task<bool> DogNzbSettings([FromBody]DogNzbSettings settings)
{ {
@ -586,6 +610,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("SickRage")] [HttpPost("SickRage")]
public async Task<bool> SickRageSettings([FromBody]SickRageSettings settings) public async Task<bool> SickRageSettings([FromBody]SickRageSettings settings)
{ {
@ -596,6 +621,7 @@ namespace Ombi.Controllers.V1
/// Gets the SickRage Settings. /// Gets the SickRage Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("SickRage")] [HttpGet("SickRage")]
public async Task<SickRageSettings> SickRageSettings() public async Task<SickRageSettings> SickRageSettings()
{ {
@ -606,6 +632,7 @@ namespace Ombi.Controllers.V1
/// Gets the JobSettings Settings. /// Gets the JobSettings Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("jobs")] [HttpGet("jobs")]
public async Task<JobSettings> JobSettings() public async Task<JobSettings> JobSettings()
{ {
@ -638,6 +665,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("jobs")] [HttpPost("jobs")]
public async Task<JobSettingsViewModel> JobSettings([FromBody]JobSettings settings) public async Task<JobSettingsViewModel> JobSettings([FromBody]JobSettings settings)
{ {
@ -681,6 +709,7 @@ namespace Ombi.Controllers.V1
} }
[HttpPost("testcron")] [HttpPost("testcron")]
[Admin]
public CronTestModel TestCron([FromBody] CronViewModelBody body) public CronTestModel TestCron([FromBody] CronViewModelBody body)
{ {
var model = new CronTestModel(); var model = new CronTestModel();
@ -714,6 +743,7 @@ namespace Ombi.Controllers.V1
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[HttpPost("Issues")] [HttpPost("Issues")]
[Admin]
public async Task<bool> IssueSettings([FromBody]IssueSettings settings) public async Task<bool> IssueSettings([FromBody]IssueSettings settings)
{ {
return await Save(settings); return await Save(settings);
@ -744,6 +774,7 @@ namespace Ombi.Controllers.V1
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
/// <returns></returns> /// <returns></returns>
[HttpPost("vote")] [HttpPost("vote")]
[Admin]
public async Task<bool> VoteSettings([FromBody]VoteSettings settings) public async Task<bool> VoteSettings([FromBody]VoteSettings settings)
{ {
return await Save(settings); return await Save(settings);
@ -754,6 +785,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet("vote")] [HttpGet("vote")]
[Admin]
public async Task<VoteSettings> VoteSettings() public async Task<VoteSettings> VoteSettings()
{ {
return await Get<VoteSettings>(); return await Get<VoteSettings>();
@ -772,6 +804,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="settings">The settings.</param> /// <param name="settings">The settings.</param>
[HttpPost("themoviedb")] [HttpPost("themoviedb")]
[Admin]
public async Task<bool> TheMovieDbSettings([FromBody]TheMovieDbSettings settings) public async Task<bool> TheMovieDbSettings([FromBody]TheMovieDbSettings settings)
{ {
return await Save(settings); return await Save(settings);
@ -780,6 +813,7 @@ namespace Ombi.Controllers.V1
/// <summary> /// <summary>
/// Get The Movie DB settings. /// Get The Movie DB settings.
/// </summary> /// </summary>
[Admin]
[HttpGet("themoviedb")] [HttpGet("themoviedb")]
public async Task<TheMovieDbSettings> TheMovieDbSettings() public async Task<TheMovieDbSettings> TheMovieDbSettings()
{ {
@ -791,6 +825,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/email")] [HttpPost("notifications/email")]
public async Task<bool> EmailNotificationSettings([FromBody] EmailNotificationsViewModel model) public async Task<bool> EmailNotificationSettings([FromBody] EmailNotificationsViewModel model)
{ {
@ -808,6 +843,7 @@ namespace Ombi.Controllers.V1
/// Gets the Email Notification Settings. /// Gets the Email Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/email")] [HttpGet("notifications/email")]
public async Task<EmailNotificationsViewModel> EmailNotificationSettings() public async Task<EmailNotificationsViewModel> EmailNotificationSettings()
{ {
@ -838,6 +874,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/discord")] [HttpPost("notifications/discord")]
public async Task<bool> DiscordNotificationSettings([FromBody] DiscordNotificationsViewModel model) public async Task<bool> DiscordNotificationSettings([FromBody] DiscordNotificationsViewModel model)
{ {
@ -855,6 +892,7 @@ namespace Ombi.Controllers.V1
/// Gets the discord Notification Settings. /// Gets the discord Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/discord")] [HttpGet("notifications/discord")]
public async Task<DiscordNotificationsViewModel> DiscordNotificationSettings() public async Task<DiscordNotificationsViewModel> DiscordNotificationSettings()
{ {
@ -873,6 +911,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/telegram")] [HttpPost("notifications/telegram")]
public async Task<bool> TelegramNotificationSettings([FromBody] TelegramNotificationsViewModel model) public async Task<bool> TelegramNotificationSettings([FromBody] TelegramNotificationsViewModel model)
{ {
@ -890,6 +929,7 @@ namespace Ombi.Controllers.V1
/// Gets the telegram Notification Settings. /// Gets the telegram Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/telegram")] [HttpGet("notifications/telegram")]
public async Task<TelegramNotificationsViewModel> TelegramNotificationSettings() public async Task<TelegramNotificationsViewModel> TelegramNotificationSettings()
{ {
@ -907,6 +947,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/pushbullet")] [HttpPost("notifications/pushbullet")]
public async Task<bool> PushbulletNotificationSettings([FromBody] PushbulletNotificationViewModel model) public async Task<bool> PushbulletNotificationSettings([FromBody] PushbulletNotificationViewModel model)
{ {
@ -924,6 +965,7 @@ namespace Ombi.Controllers.V1
/// Gets the pushbullet Notification Settings. /// Gets the pushbullet Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/pushbullet")] [HttpGet("notifications/pushbullet")]
public async Task<PushbulletNotificationViewModel> PushbulletNotificationSettings() public async Task<PushbulletNotificationViewModel> PushbulletNotificationSettings()
{ {
@ -941,6 +983,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/pushover")] [HttpPost("notifications/pushover")]
public async Task<bool> PushoverNotificationSettings([FromBody] PushoverNotificationViewModel model) public async Task<bool> PushoverNotificationSettings([FromBody] PushoverNotificationViewModel model)
{ {
@ -958,6 +1001,7 @@ namespace Ombi.Controllers.V1
/// Gets the pushover Notification Settings. /// Gets the pushover Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/pushover")] [HttpGet("notifications/pushover")]
public async Task<PushoverNotificationViewModel> PushoverNotificationSettings() public async Task<PushoverNotificationViewModel> PushoverNotificationSettings()
{ {
@ -976,6 +1020,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/slack")] [HttpPost("notifications/slack")]
public async Task<bool> SlacktNotificationSettings([FromBody] SlackNotificationsViewModel model) public async Task<bool> SlacktNotificationSettings([FromBody] SlackNotificationsViewModel model)
{ {
@ -993,6 +1038,7 @@ namespace Ombi.Controllers.V1
/// Gets the slack Notification Settings. /// Gets the slack Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/slack")] [HttpGet("notifications/slack")]
public async Task<SlackNotificationsViewModel> SlackNotificationSettings() public async Task<SlackNotificationsViewModel> SlackNotificationSettings()
{ {
@ -1010,6 +1056,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/mattermost")] [HttpPost("notifications/mattermost")]
public async Task<bool> MattermostNotificationSettings([FromBody] MattermostNotificationsViewModel model) public async Task<bool> MattermostNotificationSettings([FromBody] MattermostNotificationsViewModel model)
{ {
@ -1027,6 +1074,7 @@ namespace Ombi.Controllers.V1
/// Gets the Mattermost Notification Settings. /// Gets the Mattermost Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/mattermost")] [HttpGet("notifications/mattermost")]
public async Task<MattermostNotificationsViewModel> MattermostNotificationSettings() public async Task<MattermostNotificationsViewModel> MattermostNotificationSettings()
{ {
@ -1043,6 +1091,7 @@ namespace Ombi.Controllers.V1
/// Gets the Twilio Notification Settings. /// Gets the Twilio Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/twilio")] [HttpGet("notifications/twilio")]
public async Task<TwilioSettingsViewModel> TwilioNotificationSettings() public async Task<TwilioSettingsViewModel> TwilioNotificationSettings()
{ {
@ -1064,6 +1113,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/twilio")] [HttpPost("notifications/twilio")]
public async Task<bool> TwilioNotificationSettings([FromBody] TwilioSettingsViewModel model) public async Task<bool> TwilioNotificationSettings([FromBody] TwilioSettingsViewModel model)
{ {
@ -1082,6 +1132,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/mobile")] [HttpPost("notifications/mobile")]
public async Task<bool> MobileNotificationSettings([FromBody] MobileNotificationsViewModel model) public async Task<bool> MobileNotificationSettings([FromBody] MobileNotificationsViewModel model)
{ {
@ -1099,6 +1150,7 @@ namespace Ombi.Controllers.V1
/// Gets the Mobile Notification Settings. /// Gets the Mobile Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/mobile")] [HttpGet("notifications/mobile")]
public async Task<MobileNotificationsViewModel> MobileNotificationSettings() public async Task<MobileNotificationsViewModel> MobileNotificationSettings()
{ {
@ -1116,6 +1168,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/gotify")] [HttpPost("notifications/gotify")]
public async Task<bool> GotifyNotificationSettings([FromBody] GotifyNotificationViewModel model) public async Task<bool> GotifyNotificationSettings([FromBody] GotifyNotificationViewModel model)
{ {
@ -1133,6 +1186,7 @@ namespace Ombi.Controllers.V1
/// Gets the gotify Notification Settings. /// Gets the gotify Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/gotify")] [HttpGet("notifications/gotify")]
public async Task<GotifyNotificationViewModel> GotifyNotificationSettings() public async Task<GotifyNotificationViewModel> GotifyNotificationSettings()
{ {
@ -1150,6 +1204,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/webhook")] [HttpPost("notifications/webhook")]
public async Task<bool> WebhookNotificationSettings([FromBody] WebhookNotificationViewModel model) public async Task<bool> WebhookNotificationSettings([FromBody] WebhookNotificationViewModel model)
{ {
@ -1163,6 +1218,7 @@ namespace Ombi.Controllers.V1
/// Gets the webhook notification settings. /// Gets the webhook notification settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/webhook")] [HttpGet("notifications/webhook")]
public async Task<WebhookNotificationViewModel> WebhookNotificationSettings() public async Task<WebhookNotificationViewModel> WebhookNotificationSettings()
{ {
@ -1177,6 +1233,7 @@ namespace Ombi.Controllers.V1
/// </summary> /// </summary>
/// <param name="model">The model.</param> /// <param name="model">The model.</param>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpPost("notifications/newsletter")] [HttpPost("notifications/newsletter")]
public async Task<bool> NewsletterSettings([FromBody] NewsletterNotificationViewModel model) public async Task<bool> NewsletterSettings([FromBody] NewsletterNotificationViewModel model)
{ {
@ -1191,6 +1248,7 @@ namespace Ombi.Controllers.V1
} }
[ApiExplorerSettings(IgnoreApi = true)] [ApiExplorerSettings(IgnoreApi = true)]
[Admin]
[HttpPost("notifications/newsletterdatabase")] [HttpPost("notifications/newsletterdatabase")]
public async Task<bool> UpdateNewsletterDatabase() public async Task<bool> UpdateNewsletterDatabase()
{ {
@ -1201,6 +1259,7 @@ namespace Ombi.Controllers.V1
/// Gets the Newsletter Notification Settings. /// Gets the Newsletter Notification Settings.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[Admin]
[HttpGet("notifications/newsletter")] [HttpGet("notifications/newsletter")]
public async Task<NewsletterNotificationViewModel> NewsletterSettings() public async Task<NewsletterNotificationViewModel> NewsletterSettings()
{ {