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

Fix: Appropriate message on error

parent 548533c1
No related branches found
No related tags found
1 merge request!106Fix: Appropriate message on error
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment