Skip to content

Commit

Permalink
Fix SetMetadataAsync implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Wilms committed Nov 14, 2024
1 parent d65086c commit 1228a82
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Nexus/API/v1/CatalogsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,8 @@ public Task
{
catalogId = WebUtility.UrlDecode(catalogId);

var response = ProtectCatalogAsync<object>(catalogId, ensureReadable: true, ensureWritable: false, async catalogContainer =>
var response = ProtectCatalogAsync<object>(catalogId, ensureReadable: false, ensureWritable: true, async catalogContainer =>
{
var canEdit = AuthUtilities.IsCatalogWritable(catalogId, catalogContainer.Metadata, User);

if (!canEdit)
return StatusCode(StatusCodes.Status403Forbidden, $"The current user is not permitted to modify the catalog {catalogId}.");

await catalogContainer.UpdateMetadataAsync(metadata);

return new object();
Expand Down

0 comments on commit 1228a82

Please sign in to comment.