Adds library management authorization permission

This commit is contained in:
BinaryAlley committed 2025-01-10 19:33:02 +02:00
1 parent 45a0cb4276
commit d4ef2dfa9f
8 files changed
+53 -67

No files matched your search

@@ -1,5 +1,7 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Attributes;
using Lumina.Presentation.Web.Common.Enums.Authorization;
using Lumina.Presentation.Web.Common.Models.Libraries;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -63,6 +65,7 @@ public class LibraryManagementController : Controller
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[ValidateAntiForgeryToken]
[HttpPost("api-item")]
[RequirePermission(AuthorizationPermission.canCreateLibraries)]
public async Task<IActionResult> SaveLibrary([FromBody] LibraryModel data, CancellationToken cancellationToken)
{
// call different API endpoints based on whether this is a new library or an existing one