Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: Container Registry, Job Artifacs,. Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit 49d0779c authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Fix getting users for a project (coscine/issues#182)

parent 6ff32f04
......@@ -36,8 +36,7 @@ namespace Coscine.Api.Project.Controllers
if (projectModel.OwnsProject(user, projectModel.GetById(projectIdGuid)))
{
return _projectRoleModel.GetAllWhere((projectRole) =>
(projectRole.UserId == user.Id
&& projectRole.ProjectId == projectIdGuid)
(projectRole.ProjectId == projectIdGuid)
).Select((projectRole) =>
{
User userInst = projectRole.User;
......@@ -78,19 +77,18 @@ namespace Coscine.Api.Project.Controllers
}));
}
[HttpDelete("[controller]")]
public IActionResult Delete()
[HttpDelete("[controller]/project/{projectId}/user/{userId}/role/{roleId}")]
public IActionResult Delete(Guid projectId, Guid userId, Guid roleId)
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
ProjectRoleObject projectRoleObject = ObjectFactory<ProjectRoleObject>.DeserializeFromStream(Request.Body);
ProjectModel projectModel = new ProjectModel();
if (projectModel.OwnsProject(user, projectModel.GetById(projectRoleObject.ProjectId)))
if (projectModel.OwnsProject(user, projectModel.GetById(projectId)))
{
return _projectRoleModel.Delete(_projectRoleModel.GetWhere((projectRole) =>
projectRole.ProjectId == projectRoleObject.ProjectId
&& projectRole.UserId == projectRoleObject.User.Id
&& projectRole.RoleId == projectRoleObject.Role.Id));
projectRole.ProjectId == projectId
&& projectRole.UserId == userId
&& projectRole.RoleId == roleId));
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment