From 66cf86c0b485b3732f62d7ed0ec551b14dcac2e3 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Mon, 20 Aug 2018 13:41:37 -0400 Subject: [PATCH] Fix create dir API --- docs/API.dox | 2 +- .../Controllers/ConfigurationController.cs | 3 ++- v4_prototype_TODO.txt | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/API.dox b/docs/API.dox index d1fbde97e6..4d5c8a51fc 100644 --- a/docs/API.dox +++ b/docs/API.dox @@ -398,7 +398,7 @@ If you do not have access to list the requested directory, a 403 response will b To create an empty config directory use the following request -I POST "/Config/List/" => @ref Tgstation.Server.Api.Models.ConfigurationFile +I PUT "/Config" @ref Tgstation.Server.Api.Models.ConfigurationFile => @ref Tgstation.Server.Api.Models.ConfigurationFile To get the content of a static file use the following method diff --git a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs index aecf50f624..8823ee4de5 100644 --- a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs +++ b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs @@ -129,7 +129,8 @@ namespace Tgstation.Server.Host.Controllers public override Task List(CancellationToken cancellationToken) => Directory(null, cancellationToken); /// - public override async Task Create(ConfigurationFile model, CancellationToken cancellationToken) + [TgsAuthorize(ConfigurationRights.Write)] + public override async Task Create([FromBody] ConfigurationFile model, CancellationToken cancellationToken) { if (ForbidDueToModeConflicts()) return Forbid(); diff --git a/v4_prototype_TODO.txt b/v4_prototype_TODO.txt index 830b59ef57..3b97a1ae4d 100644 --- a/v4_prototype_TODO.txt +++ b/v4_prototype_TODO.txt @@ -6,5 +6,3 @@ Only show user name and ID when serializing to API In fact remove IApiConvertable<> altogether, it's not required by anything Chat channel tagging - -Directory create function \ No newline at end of file