From cc9ae2f8759a2cabd72e6e1dbd5e7b23f0a20359 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Sat, 16 Nov 2024 18:21:21 +0200 Subject: [PATCH] Adds missing authorization to some controllers --- .../Controllers/FileSystemManagement/DirectoriesController.cs | 2 ++ .../Controllers/FileSystemManagement/DrivesController.cs | 2 ++ .../Controllers/FileSystemManagement/FileSystemController.cs | 2 ++ .../Controllers/FileSystemManagement/FilesController.cs | 2 ++ .../Controllers/FileSystemManagement/PathController.cs | 2 ++ .../Library/Management/LibraryManagementController.cs | 2 ++ .../WrittenContentLibrary/BookLibrary/BooksController.cs | 2 ++ 7 files changed, 14 insertions(+) diff --git a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DirectoriesController.cs b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DirectoriesController.cs index 9de82e2e..a8dca34d 100644 --- a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DirectoriesController.cs +++ b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DirectoriesController.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.Models.FileSystemManagement; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; @@ -14,6 +15,7 @@ namespace Lumina.Presentation.Web.Controllers.FileSystemManagement; /// /// Controller for managing file system directories. /// +[Authorize] [Route("[controller]")] public class DirectoriesController : Controller { diff --git a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DrivesController.cs b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DrivesController.cs index 452af89c..e67881cc 100644 --- a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DrivesController.cs +++ b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/DrivesController.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.Models.FileSystemManagement; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Threading; using System.Threading.Tasks; @@ -11,6 +12,7 @@ namespace Lumina.Presentation.Web.Controllers.FileSystemManagement; /// /// Controller for managing file system drives. /// +[Authorize] [Route("[controller]")] public class DrivesController : Controller { diff --git a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FileSystemController.cs b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FileSystemController.cs index a579147f..eab3ea6c 100644 --- a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FileSystemController.cs +++ b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FileSystemController.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.Models.FileSystemManagement; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Threading; using System.Threading.Tasks; @@ -11,6 +12,7 @@ namespace Lumina.Presentation.Web.Controllers.FileSystemManagement; /// /// Controller for managing file systems. /// +[Authorize] [Route("/file-system")] public class FileSystemController : Controller { diff --git a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FilesController.cs b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FilesController.cs index e327ef23..3d000af5 100644 --- a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FilesController.cs +++ b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/FilesController.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.Models.FileSystemManagement; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; @@ -14,6 +15,7 @@ namespace Lumina.Presentation.Web.Controllers.FileSystemManagement; /// /// Controller for managing file system files. /// +[Authorize] [Route("[controller]")] public class FilesController : Controller { diff --git a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/PathController.cs b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/PathController.cs index 11cf8b9c..5be18cd2 100644 --- a/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/PathController.cs +++ b/src/Lumina.Presentation.Web/Controllers/FileSystemManagement/PathController.cs @@ -1,6 +1,7 @@ #region ========================================================================= USING ===================================================================================== using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.Models.FileSystemManagement; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Threading; @@ -12,6 +13,7 @@ namespace Lumina.Presentation.Web.Controllers.FileSystemManagement; /// /// Controller for managing file system paths. /// +[Authorize] [Route("[controller]")] public class PathController : Controller { diff --git a/src/Lumina.Presentation.Web/Controllers/Library/Management/LibraryManagementController.cs b/src/Lumina.Presentation.Web/Controllers/Library/Management/LibraryManagementController.cs index cc77f34e..ae82668c 100644 --- a/src/Lumina.Presentation.Web/Controllers/Library/Management/LibraryManagementController.cs +++ b/src/Lumina.Presentation.Web/Controllers/Library/Management/LibraryManagementController.cs @@ -2,6 +2,7 @@ using Lumina.Presentation.Web.Common.Api; using Lumina.Presentation.Web.Common.Enums.Library; using Lumina.Presentation.Web.Common.Models.Libraries; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Formatters; using System; @@ -10,6 +11,7 @@ using System.Threading.Tasks; namespace Lumina.Presentation.Web.Controllers.Library.Management; +[Authorize] [Route("/library/manage/")] public class LibraryManagementController : Controller { diff --git a/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs b/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs index 0cd52639..bdecbc89 100644 --- a/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs +++ b/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs @@ -1,8 +1,10 @@ +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; namespace Lumina.Presentation.Web.Controllers.Library.WrittenContentLibrary.BookLibrary; +[Authorize] [Route("/library/written-content-library/books-library/books/")] public class BooksController : Controller {