diff options
| author | Niels van Velzen <git@ndat.nl> | 2024-04-25 21:52:20 +0200 |
|---|---|---|
| committer | Niels van Velzen <git@ndat.nl> | 2024-04-26 19:00:53 +0200 |
| commit | 935c2c97fe2b8d8c5ec7cf4c53d941da34983295 (patch) | |
| tree | c06c8a63ab140b7e8342b19530dbdb4f4a0e8684 /Jellyfin.Api/Controllers/PluginsController.cs | |
| parent | 5612cb81780aaaae581b87062445d1829e71a4a9 (diff) | |
Require elevation for plugin related endpoints
Diffstat (limited to 'Jellyfin.Api/Controllers/PluginsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/PluginsController.cs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.cs index f63e63927..6abd7a23e 100644 --- a/Jellyfin.Api/Controllers/PluginsController.cs +++ b/Jellyfin.Api/Controllers/PluginsController.cs @@ -22,7 +22,7 @@ namespace Jellyfin.Api.Controllers; /// <summary> /// Plugins controller. /// </summary> -[Authorize] +[Authorize(Policy = Policies.RequiresElevation)] public class PluginsController : BaseJellyfinApiController { private readonly IInstallationManager _installationManager; @@ -66,7 +66,6 @@ public class PluginsController : BaseJellyfinApiController /// <response code="404">Plugin not found.</response> /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the plugin could not be found.</returns> [HttpPost("{pluginId}/{version}/Enable")] - [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult EnablePlugin([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version) @@ -90,7 +89,6 @@ public class PluginsController : BaseJellyfinApiController /// <response code="404">Plugin not found.</response> /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the plugin could not be found.</returns> [HttpPost("{pluginId}/{version}/Disable")] - [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult DisablePlugin([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version) @@ -114,7 +112,6 @@ public class PluginsController : BaseJellyfinApiController /// <response code="404">Plugin not found.</response> /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the plugin could not be found.</returns> [HttpDelete("{pluginId}/{version}")] - [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult UninstallPluginByVersion([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version) @@ -137,7 +134,6 @@ public class PluginsController : BaseJellyfinApiController /// <response code="404">Plugin not found.</response> /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the plugin could not be found.</returns> [HttpDelete("{pluginId}")] - [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] [Obsolete("Please use the UninstallPluginByVersion API.")] |
