Skip to content
Snippets Groups Projects

Fix: Appropriate message on error

Merged Petar Hristov requested to merge Hotfix/2384-guestsAndLinked into master
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -368,9 +368,11 @@ namespace Coscine.Api.Tree.Controllers
var user = _authenticator.GetUser();
var resource = _resourceModel.GetById(Guid.Parse(resourceId));
// Rights Matrix (https://git.rwth-aachen.de/coscine/docs/private/internal-wiki/-/blob/master/coscine/Definition%20of%20rights%20Matrix.md)
// - Resource: Change Resource (RCV, Metadatamanager)
if (user == null || !_resourceModel.HasAccess(user, resource, UserRoles.Owner, UserRoles.Member))
{
return BadRequest("User is no project member!");
return Unauthorized("The user is not allowed to save changes to the resource!");
}
if (resource.Archived == "1")
Loading