Skip to content
Snippets Groups Projects
Commit 605aaaa7 authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Fix: changed Forbid() method to BadRequest() method for displaying the correct...

Fix: changed Forbid() method to BadRequest() method for displaying the correct message (coscine/issues#1575)
parent 77641405
No related branches found
No related tags found
1 merge request!35Update: Check for archived status (coscine/issues#1575)
using Coscine.ApiCommons; using Coscine.ApiCommons;
using Coscine.Configuration; using Coscine.Configuration;
using Coscine.Database.DataModel; using Coscine.Database.DataModel;
using Coscine.Database.Models; using Coscine.Database.Models;
...@@ -106,7 +106,7 @@ namespace Coscine.Api.Blob.Controllers ...@@ -106,7 +106,7 @@ namespace Coscine.Api.Blob.Controllers
if (user == null || !_resourceModel.HasAccess(user, resource, UserRoles.Owner, UserRoles.Member)) if (user == null || !_resourceModel.HasAccess(user, resource, UserRoles.Owner, UserRoles.Member))
{ {
return Forbid("User does not have permission to the resource."); return BadRequest("User does not have permission to the resource.");
} }
if ((resource.Type.DisplayName.ToLower() == "rds" || resource.Type.DisplayName.ToLower() == "rdss3") && resource.ResourceTypeOptionId.HasValue) if ((resource.Type.DisplayName.ToLower() == "rds" || resource.Type.DisplayName.ToLower() == "rdss3") && resource.ResourceTypeOptionId.HasValue)
...@@ -212,7 +212,7 @@ namespace Coscine.Api.Blob.Controllers ...@@ -212,7 +212,7 @@ namespace Coscine.Api.Blob.Controllers
if (resource.Archived == "1") if (resource.Archived == "1")
{ {
return Forbid("The resource is readonly!"); return BadRequest("The resource is readonly!");
} }
if (files.Count != 1) if (files.Count != 1)
...@@ -285,7 +285,7 @@ namespace Coscine.Api.Blob.Controllers ...@@ -285,7 +285,7 @@ namespace Coscine.Api.Blob.Controllers
if (resource.Archived == "1") if (resource.Archived == "1")
{ {
return Forbid("The resource is readonly!"); return BadRequest("The resource is readonly!");
} }
try try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment