...
 
Commits (3)
using Coscine.Api.Project.Models;
using Coscine.Api.Project.Controllers;
using Coscine.Api.Project.Models;
using Coscine.ApiCommons.Utils;
using Coscine.Database.Model;
using Microsoft.AspNetCore.Http;
......@@ -24,6 +25,13 @@ namespace Coscine.Api.Project.Tests
protected readonly List<ProjectRole> ProjectRoles = new List<ProjectRole>();
protected readonly List<ResourceType> ResourceTypes = new List<ResourceType>();
protected readonly List<Resource> Resources = new List<Resource>();
protected readonly List<ResourceDiscipline> ResourceDisciplines = new List<ResourceDiscipline>();
protected Discipline Discipline { get; set; }
protected Institute Institute { get; set; }
protected Visibility Visibility { get; set; }
protected License License { get; set; }
protected RDSResourceType RdsResourceType { get; set; }
protected int Previous;
......@@ -35,6 +43,32 @@ namespace Coscine.Api.Project.Tests
[OneTimeSetUp]
public void Setup()
{
DisciplineModel disciplineModel = new DisciplineModel();
Discipline = new Discipline()
{
DisplayName = "TestDiscipline",
Url = "http://rwth-aachen.de"
};
disciplineModel.Insert(Discipline);
InstituteModel instituteModel = new InstituteModel();
Institute = new Institute()
{
DisplayName = "TestInstitute",
IKZ = "022000"
};
instituteModel.Insert(Institute);
VisibilityModel visibilityModel = new VisibilityModel();
Visibility = visibilityModel.GetWhere((visibility) => visibility.DisplayName == "Public");
LicenseModel licenseModel = new LicenseModel();
License = new License()
{
DisplayName = "MIT"
};
licenseModel.Insert(License);
ProjectModel projectModel = new ProjectModel();
Previous = projectModel.GetAll().ToArray().Length;
......@@ -54,63 +88,120 @@ namespace Coscine.Api.Project.Tests
var project = new Coscine.Database.Model.Project()
{
Description = "Description",
Organization = "Organization",
ProjectName = "TestProject",
DisplayName = "TestProject",
StartDate = DateTime.Now,
EndDate = DateTime.Now.AddYears(1),
Keywords = "Test1;Test2"
Keywords = "Test1;Test2",
GrantId = "testid",
PrincipleInvestigators = "TestInvestigator",
VisibilityId = Visibility.Id
};
projectModel.Insert(project);
var projectRole = projectModel.SetOwner(project, user);
ProjectRoles.Add(projectRole);
ProjectDisciplineModel projectDisciplineModel = new ProjectDisciplineModel();
projectDisciplineModel.Insert(new ProjectDiscipline()
{
DisciplineId = Discipline.Id,
ProjectId = project.Id
});
ProjectInstituteModel projectInstituteModel = new ProjectInstituteModel();
projectInstituteModel.Insert(new ProjectInstitute()
{
InstituteId = Institute.Id,
ProjectId = project.Id
});
Projects.Add(projectModel.GetById(project.Id));
var project2 = new Coscine.Database.Model.Project()
{
Description = "Description2",
Organization = "Organization2",
ProjectName = "TestProject",
DisplayName = "TestProject2",
StartDate = DateTime.Now,
EndDate = DateTime.Now.AddYears(1),
Keywords = "Test1;Test2"
Keywords = "Test1;Test2",
GrantId = "testid",
PrincipleInvestigators = "TestInvestigator",
VisibilityId = Visibility.Id
};
projectModel.Insert(project2);
Projects.Add(projectModel.GetById(project2.Id));
ResourceTypeModel resourceTypeModel = new ResourceTypeModel();
var resourceType = new ResourceType()
var resourceType = resourceTypeModel.GetWhere((dbResourceType) => dbResourceType.DisplayName == "rds");
RDSResourceTypeModel rdsResourceTypeModel = new RDSResourceTypeModel();
RdsResourceType = new RDSResourceType()
{
DisplayName = "TestType"
AccessKey = "a",
SecretKey = "b",
BucketName = "c",
};
resourceTypeModel.Insert(resourceType);
ResourceTypes.Add(resourceType);
rdsResourceTypeModel.Insert(RdsResourceType);
ResourceModel resourceModel = new ResourceModel();
var resource = new Resource()
{
ExternalId = "123",
Url = "http://rwth-aachen.de/test",
DisplayName = "ResourceTest1",
ResourceName = "ResourceTest1",
Keywords = "ResourceTest1",
UsageRights = "ResourceTest1",
TypeId = resourceType.Id,
Type = resourceType
Type = resourceType,
Visibility = Visibility,
VisibilityId = Visibility.Id,
LicenseId = License.Id,
ResourceTypeOptionId = RdsResourceType.Id
};
resourceModel.Insert(resource);
projectModel.AddResource(project, resource);
Resources.Add(resource);
resourceType = resourceTypeModel.GetWhere((dbResourceType) => dbResourceType.DisplayName == "gitlab");
var resource2 = new Resource()
{
ExternalId = "12345",
Url = "http://rwth-aachen.de/test2",
DisplayName = "ResourceTest2",
ResourceName = "ResourceTest2",
Keywords = "ResourceTest2",
UsageRights = "ResourceTest2",
TypeId = resourceType.Id,
Type = resourceType
Type = resourceType,
Visibility = Visibility,
VisibilityId = Visibility.Id,
LicenseId = License.Id
};
resourceModel.Insert(resource2);
projectModel.AddResource(project2, resource2);
Resources.Add(resource2);
ResourceDisciplineModel resourceDisciplineModel = new ResourceDisciplineModel();
ResourceDiscipline resourceDiscipline = new ResourceDiscipline()
{
DisciplineId = Discipline.Id,
ResourceId = resource.Id
};
resourceDisciplineModel.Insert(resourceDiscipline);
ResourceDisciplines.Add(resourceDiscipline);
resourceDiscipline = new ResourceDiscipline()
{
DisciplineId = Discipline.Id,
ResourceId = resource2.Id
};
resourceDisciplineModel.Insert(resourceDiscipline);
ResourceDisciplines.Add(resourceDiscipline);
}
......@@ -193,26 +284,43 @@ namespace Coscine.Api.Project.Tests
{
projectResourceModel.Delete(projectResource);
}
ProjectModel projectModel = new ProjectModel();
ProjectController projectController = new ProjectController();
foreach (var project in Projects)
{
projectModel.Delete(project);
projectController.DeleteProject(project);
}
UserModel userModel = new UserModel();
foreach (var user in Users)
{
userModel.Delete(user);
}
ResourceDisciplineModel resourceDisciplineModel = new ResourceDisciplineModel();
foreach (var resourceDiscipline in ResourceDisciplines)
{
resourceDisciplineModel.Delete(resourceDiscipline);
}
ResourceModel resourceModel = new ResourceModel();
foreach (var resource in Resources)
{
resourceModel.Delete(resource);
resourceModel.DeleteResource(resource);
}
ResourceTypeModel resourceTypeModel = new ResourceTypeModel();
foreach (var resourceType in ResourceTypes)
{
resourceTypeModel.Delete(resourceType);
}
DisciplineModel disciplineModel = new DisciplineModel();
disciplineModel.Delete(Discipline);
InstituteModel instituteModel = new InstituteModel();
instituteModel.Delete(Institute);
LicenseModel licenseModel = new LicenseModel();
licenseModel.Delete(License);
RDSResourceTypeModel rdsResourceTypeModel = new RDSResourceTypeModel();
rdsResourceTypeModel.Delete(RdsResourceType);
}
}
}
\ No newline at end of file
......@@ -64,8 +64,8 @@
<Reference Include="Coscine.Configuration, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Configuration.1.4.0\lib\net461\Coscine.Configuration.dll</HintPath>
</Reference>
<Reference Include="Coscine.Database, Version=1.5.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.5.0\lib\net461\Coscine.Database.dll</HintPath>
<Reference Include="Coscine.Database, Version=1.6.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.6.0\lib\net461\Coscine.Database.dll</HintPath>
</Reference>
<Reference Include="Coscine.ProxyApi, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ProxyApi.1.2.0\lib\net461\Coscine.ProxyApi.dll</HintPath>
......@@ -565,6 +565,7 @@
<Compile Include="ProjectControllerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourceControllerTests.cs" />
<Compile Include="ResourceTypeControllerTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
......
This diff is collapsed.
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Project.Tests is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Project.Tests")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyInformationalVersion("1.4.0.0")]
[assembly: AssemblyCopyright("2019 IT Center, RWTH Aachen University")]
......@@ -4,8 +4,10 @@ using Coscine.Api.Project.ReturnObjects;
using Coscine.ApiCommons.Exceptions;
using Coscine.ApiCommons.Factories;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
namespace Coscine.Api.Project.Tests
......@@ -33,13 +35,13 @@ namespace Coscine.Api.Project.Tests
OkObjectResult okObjectResult = (OkObjectResult)actionResult;
Assert.IsTrue(okObjectResult.Value.GetType() == typeof(ResourceObject));
ResourceObject projectObject = (ResourceObject)okObjectResult.Value;
ResourceObject resourceObject = (ResourceObject)okObjectResult.Value;
Assert.IsTrue(projectObject.Id == Resources[0].Id);
Assert.IsTrue(projectObject.ExternalId == Resources[0].ExternalId);
Assert.IsTrue(projectObject.Type.Id == Resources[0].Type.Id);
Assert.IsTrue(projectObject.Type.DisplayName == Resources[0].Type.DisplayName);
Assert.IsTrue(projectObject.Url == Resources[0].Url);
Assert.IsTrue(resourceObject.Id == Resources[0].Id);
Assert.IsTrue(resourceObject.DisplayName == Resources[0].DisplayName);
Assert.IsTrue(resourceObject.Visibility.DisplayName == Resources[0].Visibility.DisplayName);
Assert.IsTrue(resourceObject.Type.Id == Resources[0].Type.Id);
Assert.IsTrue(resourceObject.Type.DisplayName == Resources[0].Type.DisplayName);
}
......@@ -50,7 +52,8 @@ namespace Coscine.Api.Project.Tests
OkObjectResult okObjectResult = (OkObjectResult)actionResult;
ResourceObject resourceObject = (ResourceObject)okObjectResult.Value;
resourceObject.ExternalId = "ChangedExternalId";
resourceObject.DisplayName = "OtherName";
resourceObject.ResourceTypeOption = JObject.FromObject(new RDSResourceTypeObject(Guid.NewGuid(), "PITLABTTEST", "accesskey", "secretkey"));
Stream stream = ObjectFactory<ResourceObject>.SerializeToStream(resourceObject);
......@@ -83,7 +86,18 @@ namespace Coscine.Api.Project.Tests
[Test]
public void TestControllerStoreToProject()
{
ResourceObject resourceObject = new ResourceObject(Guid.NewGuid(), "externalId", "http://rwth-aachen.de/newTest", "TestResource", new ResourceTypeObject(ResourceTypes[0].Id, ResourceTypes[0].DisplayName));
ResourceObject resourceObject = new ResourceObject(
Guid.NewGuid(),
"Test",
"testR",
"keys",
"usageR",
new ResourceTypeObject(Resources[0].Type.Id, Resources[0].Type.DisplayName),
new List<DisciplineObject>() { new DisciplineObject(Discipline.Id, Discipline.Url, Discipline.DisplayName) },
new VisibilityObject(Visibility.Id, Visibility.DisplayName),
new LicenseObject(License.Id, License.DisplayName),
JObject.FromObject(new RDSResourceTypeObject(Guid.NewGuid(), "PITLABTTEST", "accesskey", "secretkey"))
);
Stream stream = ObjectFactory<ResourceObject>.SerializeToStream(resourceObject);
......@@ -97,16 +111,14 @@ namespace Coscine.Api.Project.Tests
// Cleanup
stream.Close();
ResourceModel resourceModel = new ResourceModel();
var resource = resourceModel.GetById(resourceObject.Id);
stream = ObjectFactory<ResourceObject>.SerializeToStream(resourceObject);
ProjectResourceModel projectResourceModel = new ProjectResourceModel();
foreach(var projectResource in projectResourceModel.GetAllWhere((projectResource) => projectResource.ProjectId == Projects[0].Id && projectResource.ResourceId == resource.Id))
{
projectResourceModel.Delete(projectResource);
}
FakeControllerContext(Users[0], stream);
actionResult = Controller.Delete(resourceObject.Id.ToString());
Assert.IsTrue(actionResult.GetType() == typeof(OkObjectResult));
resourceModel.Delete(resource);
stream.Close();
}
}
}
using Coscine.Api.Project.Controllers;
using Microsoft.AspNetCore.Mvc;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Tests
{
[TestFixture]
public class ResourceTypeControllerTests : DefaultControllerTests<ResourceTypeController>
{
public ResourceTypeControllerTests() : base(new ResourceTypeController())
{
}
[Test]
public void TestGettingFields()
{
var actionResult = Controller.Fields(Resources[0].Type.Id.ToString());
Assert.IsTrue(actionResult.GetType() == typeof(OkObjectResult));
OkObjectResult okObjectResult = (OkObjectResult)actionResult;
List<string> fields = (List<string>) okObjectResult.Value;
if(fields.Count() == 3)
{
Assert.IsTrue(fields[0] == "BucketName");
Assert.IsTrue(fields[1] == "AccessKey");
Assert.IsTrue(fields[2] == "SecretKey");
}
else
{
Assert.Fail("Wrong field count!");
}
}
}
}
......@@ -88,7 +88,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Coscine.Database" publicKeyToken="767d77427707b70a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.6.0.0" newVersion="1.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
......
......@@ -7,7 +7,7 @@
<package id="Coscine.Action" version="1.3.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.2.1" targetFramework="net472" />
<package id="Coscine.Configuration" version="1.4.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.5.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.6.0" targetFramework="net472" />
<package id="Coscine.ProxyApi" version="1.2.0" targetFramework="net472" />
<package id="Coscine.SharePoint.Webparts.Vue" version="1.4.0" targetFramework="net472" />
<package id="EntityFramework" version="6.2.0" targetFramework="net472" />
......
......@@ -91,7 +91,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Coscine.Database" publicKeyToken="767d77427707b70a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.6.0.0" newVersion="1.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
......
......@@ -75,11 +75,17 @@ namespace Coscine.Api.Project.Controllers
if (resource.Type.DisplayName.ToLower() == "rds")
{
authHeader = BuildRdsAuthHeader(resource.ExternalId);
RDSResourceTypeModel rdsResourceTypeModel = new RDSResourceTypeModel();
var rdsResourceType = rdsResourceTypeModel.GetById(resource.ResourceTypeOptionId.Value);
authHeader = BuildRdsAuthHeader(rdsResourceType);
}
else if (resource.Type.DisplayName.ToLower() == "gitlab")
{
authHeader = BuildGitlabAuthHeader(resource.ExternalId, resource.Url);
GitlabResourceTypeModel gitlabResourceTypeModel = new GitlabResourceTypeModel();
var gitlabResourceType = gitlabResourceTypeModel.GetById(resource.ResourceTypeOptionId.Value);
authHeader = BuildGitlabAuthHeader(gitlabResourceType);
}
if (authHeader != null)
......@@ -146,39 +152,39 @@ namespace Coscine.Api.Project.Controllers
return _jwtHandler.GenerateJwtToken(payload);
}
private string BuildRdsAuthHeader(string bucketname)
private string BuildRdsAuthHeader(RDSResourceType rdsResourceType)
{
var auth = new Dictionary<string, object>();
var credentials = new Dictionary<string, object>
{
{ "access_key", _configuration.GetString("coscine/global/rds_access_key") },
{ "secret_key", _configuration.GetString("coscine/global/rds_secret_key") }
{ "access_key", rdsResourceType.AccessKey },
{ "secret_key", rdsResourceType.SecretKey }
};
var settings = new Dictionary<string, object>
{
{ "bucket", bucketname }
{ "bucket", rdsResourceType.BucketName }
};
return BuildWaterbutlerPayload(auth, credentials, settings);
}
private string BuildGitlabAuthHeader(string externalId, string url)
private string BuildGitlabAuthHeader(GitlabResourceType gitlabResourceType)
{
var auth = new Dictionary<string, object>();
var credentials = new Dictionary<string, object>
{
{ "token", _configuration.GetString("coscine/global/gitlabtoken") }
{ "token", gitlabResourceType.Token }
};
var settings = new Dictionary<string, object>
{
{"owner", "Tester"},
{"repo", url},
{ "repo_id", externalId},
{ "repo", gitlabResourceType.RepositoryUrl},
{ "repo_id", gitlabResourceType.RepositoryNumber},
{ "host", "https://git.rwth-aachen.de"}
};
......
using Coscine.Api.Project.Models;
using Coscine.Api.Project.ReturnObjects;
using Coscine.ApiCommons;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Controllers
{
public class DisciplineController : Controller
{
private readonly Authenticator _authenticator;
private readonly DisciplineModel _disciplineModel;
public DisciplineController()
{
_authenticator = new Authenticator(this, Program.Configuration);
_disciplineModel = new DisciplineModel();
}
[Route("[controller]")]
public IActionResult Index()
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
return _disciplineModel.GetAll().Select((discipline) => new DisciplineObject(discipline.Id, discipline.Url, discipline.DisplayName));
}));
}
}
}
using Coscine.Api.Project.Models;
using Coscine.Api.Project.ReturnObjects;
using Coscine.ApiCommons;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Controllers
{
public class InstituteController : Controller
{
private readonly Authenticator _authenticator;
private readonly InstituteModel _instituteModel;
public InstituteController()
{
_authenticator = new Authenticator(this, Program.Configuration);
_instituteModel = new InstituteModel();
}
[Route("[controller]")]
public IActionResult Index()
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
return _instituteModel.GetAll().Select((institute) => new InstituteObject(institute.Id, institute.IKZ, institute.DisplayName));
}));
}
}
}
......@@ -41,7 +41,7 @@ namespace Coscine.Api.Project.Controllers
where projectRole.User == user
&& projectRole.Role.DisplayName == "Owner"
select projectRole).Any()
).Select((project) => new ProjectObject(project.Id, project.Description, project.DisplayName, project.Organization, project.StartDate, project.EndDate, project.Keywords));
).Select((project) => _projectModel.CreateReturnObjectFromDatabaseObject(project));
}));
}
......@@ -53,7 +53,7 @@ namespace Coscine.Api.Project.Controllers
var project = _projectModel.GetById(Guid.Parse(id));
if (_projectModel.CanSeeProject(user, project))
{
return new ProjectObject(project.Id, project.Description, project.DisplayName, project.Organization, project.StartDate, project.EndDate, project.Keywords);
return _projectModel.CreateReturnObjectFromDatabaseObject(project);
}
else
{
......@@ -78,12 +78,7 @@ namespace Coscine.Api.Project.Controllers
select projectResource).Any())
.Select((resource) =>
{
ResourceType resourceType = resource.Type;
if (resourceType == null)
{
resourceType = resourceTypeModel.GetById(resource.TypeId);
}
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resourceType.Id, resourceType.DisplayName));
return resourceModel.CreateReturnObjectFromDatabaseObject(resource);
});
}
else
......@@ -111,6 +106,79 @@ namespace Coscine.Api.Project.Controllers
}));
}
[HttpDelete("[controller]/{id}")]
public IActionResult Delete(string id)
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
var project = _projectModel.GetById(Guid.Parse(id));
if (_projectModel.OwnsProject(user, project))
{
DeleteProject(project);
return _projectModel.CreateReturnObjectFromDatabaseObject(project);
}
else
{
throw new NotAuthorizedException("The user is not authorized to perform an update on the selected project!");
}
}));
}
public void DeleteProject(Coscine.Database.Model.Project project)
{
SubProjectModel subProjectModel = new SubProjectModel();
foreach(var subProject in subProjectModel.GetAllWhere((subProject) => subProject.ProjectId == project.Id))
{
subProjectModel.Delete(subProject);
DeleteProject(_projectModel.GetById(subProject.SubProjectId));
}
foreach (var subProject in subProjectModel.GetAllWhere((subProject) => subProject.SubProjectId == project.Id))
{
subProjectModel.Delete(subProject);
}
ProjectResourceModel projectResourceModel = new ProjectResourceModel();
ResourceModel resourceModel = new ResourceModel();
foreach (var projectResource in projectResourceModel.GetAllWhere((projectResource) => projectResource.ProjectId == project.Id))
{
projectResourceModel.Delete(projectResource);
resourceModel.Delete(resourceModel.GetById(projectResource.ResourceId));
}
ProjectRoleModel projectRoleModel = new ProjectRoleModel();
foreach (var projectRole in projectRoleModel.GetAllWhere((projectRole) => projectRole.ProjectId == project.Id))
{
projectRoleModel.Delete(projectRole);
}
ProjectDisciplineModel projectDisciplineModel = new ProjectDisciplineModel();
foreach (var projectDiscipline in projectDisciplineModel.GetAllWhere((projectDiscipline) => projectDiscipline.ProjectId == project.Id))
{
projectDisciplineModel.Delete(projectDiscipline);
}
ProjectInstituteModel projectInstituteModel = new ProjectInstituteModel();
foreach (var projectInstitute in projectInstituteModel.GetAllWhere((projectInstitute) => projectInstitute.ProjectId == project.Id))
{
projectInstituteModel.Delete(projectInstitute);
}
FireEvents((projectAction, projectEventArgs) =>
{
try
{
projectAction.OnProjectDelete(project, projectEventArgs);
}
catch (Exception)
{
// Filter exception, because sometimes the PID or SharePoint site might not be generated in e.g. tests
}
});
_projectModel.Delete(project);
}
[HttpPost("[controller]")]
public IActionResult Store()
{
......@@ -121,7 +189,7 @@ namespace Coscine.Api.Project.Controllers
if (projectObject.ParentId != null
&& projectObject.ParentId != new Guid()
&& _projectModel.OwnsProject(user, _projectModel.GetById(projectObject.ParentId))) // for now, only an owner can add subprojects to projects
&& _projectModel.IsMemberOrHigher(user, _projectModel.GetById(projectObject.ParentId))) // for now, only an owner can add subprojects to projects
{
SubProjectModel subProjectModel = new SubProjectModel();
subProjectModel.LinkSubProject(projectObject.ParentId, project.Id);
......@@ -129,7 +197,7 @@ namespace Coscine.Api.Project.Controllers
FireEvents((projectAction, projectEventArgs) => projectAction.OnProjectCreate(project, projectEventArgs));
return new ProjectObject(project.Id, project.Description, project.DisplayName, project.Organization, project.StartDate, project.EndDate, project.Keywords);
return _projectModel.CreateReturnObjectFromDatabaseObject(project);
}));
}
......
......@@ -59,6 +59,29 @@ namespace Coscine.Api.Project.Controllers
}));
}
//Get all roles for current user and given project
[HttpGet("[controller]/project/{projectId}")]
public IActionResult Get(string projectId)
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
RoleModel roleModel = new RoleModel();
Guid.TryParse(projectId, out Guid projectIdGuid);
UserObject userObject = new UserObject(user.Id, user.DisplayName, user.EmailAddress);
return _projectRoleModel.GetAllWhere((projectRole) =>
(projectRole.UserId == user.Id &&
projectRole.ProjectId == projectIdGuid)
).Select((projectRole) => {
if(projectRole.Role == null)
{
projectRole.Role = roleModel.GetById(projectRole.RoleId);
}
return new ProjectRoleObject(projectRole.RelationId, userObject, new RoleObject(projectRole.Role.Id, projectRole.Role.DisplayName));
});
}));
}
[HttpPost("[controller]")]
public IActionResult Set()
{
......
......@@ -3,6 +3,7 @@ using Coscine.Api.Project.ReturnObjects;
using Coscine.ApiCommons;
using Coscine.ApiCommons.Exceptions;
using Coscine.ApiCommons.Factories;
using Coscine.Database.Model;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
......@@ -32,7 +33,7 @@ namespace Coscine.Api.Project.Controllers
&& projectRole.Role.DisplayName == "Owner"
select projectRole).Any()
select projectResource).Any()
).Select((resource) => new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName)));
).Select((resource) => _resourceModel.CreateReturnObjectFromDatabaseObject(resource));
}));
}
......@@ -45,13 +46,8 @@ namespace Coscine.Api.Project.Controllers
var resource = _resourceModel.GetById(Guid.Parse(id));
if (_resourceModel.OwnsResource(user, resource))
{
//TODO: Find out why resource.Type is not set
if(resource.Type == null)
{
ResourceTypeModel resourceTypeModel = new ResourceTypeModel();
resource.Type = resourceTypeModel.GetById(resource.TypeId);
}
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName));
_resourceModel.SetType(resource);
return _resourceModel.CreateReturnObjectFromDatabaseObject(resource);
}
else
{
......@@ -78,6 +74,25 @@ namespace Coscine.Api.Project.Controllers
}));
}
[HttpDelete("[controller]/{id}")]
public IActionResult Delete(string id)
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
var resource = _resourceModel.GetById(Guid.Parse(id));
if (_resourceModel.OwnsResource(user, resource))
{
var returnObject = _resourceModel.CreateReturnObjectFromDatabaseObject(resource);
_resourceModel.DeleteResource(resource);
return returnObject;
}
else
{
throw new NotAuthorizedException("The user is not authorized to perform an update on the selected resource!");
}
}));
}
[HttpPost("[controller]/project/{projectId}")]
public IActionResult StoreToProject(string projectId)
{
......@@ -93,7 +108,7 @@ namespace Coscine.Api.Project.Controllers
projectModel.AddResource(project, resource);
return new ResourceObject(resource.Id, resource.ExternalId, resource.Url, resource.DisplayName, new ResourceTypeObject(resource.Type.Id, resource.Type.DisplayName));
return _resourceModel.CreateReturnObjectFromDatabaseObject(resource);
}
else
{
......
......@@ -31,5 +31,33 @@ namespace Coscine.Api.Project.Controllers
}));
}
[Route("[controller]/{id}/fields")]
public IActionResult Fields(string id)
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
var resourceType = _resourceTypeModel.GetById(Guid.Parse(id));
if(resourceType.DisplayName == "rds")
{
return Type.GetType("Coscine.Api.Project.ReturnObjects.RDSResourceTypeObject").GetProperties()
.Where((property) => property.Name != "Id")
.Select((property) => property.Name)
.ToList();
}
else if(resourceType.DisplayName == "gitlab")
{
return Type.GetType("Coscine.Api.Project.ReturnObjects.GitlabResourceTypeObject").GetProperties()
.Where((property) => property.Name != "Id")
.Select((property) => property.Name)
.ToList();
}
else
{
throw new ArgumentException("Invalid Resource Type!");
}
}));
}
}
}
......@@ -29,7 +29,7 @@ namespace Coscine.Api.Project.Controllers
{
var subProjects = _subProjectModel.GetAllWhere((subProjectM) => (subProjectM.ProjectId == parentGuid))
.Select((subProject) => projectModel.GetById(subProject.SubProjectId))
.Select((project) => new ProjectObject(project.Id, project.Description, project.DisplayName, project.Organization, project.StartDate, project.EndDate, project.Keywords, parentGuid));
.Select((project) => projectModel.CreateReturnObjectFromDatabaseObject(project, parentGuid));
return subProjects;
}
else
......
using Coscine.Api.Project.Models;
using Coscine.Api.Project.ReturnObjects;
using Coscine.ApiCommons;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Controllers
{
public class VisibilityController : Controller
{
private readonly Authenticator _authenticator;
private readonly VisibilityModel _visibilityModel;
public VisibilityController()
{
_authenticator = new Authenticator(this, Program.Configuration);
_visibilityModel = new VisibilityModel();
}
[Route("[controller]")]
public IActionResult Index()
{
return Ok(_authenticator.ValidateAndExecute((user) =>
{
return _visibilityModel.GetAll().Select((visibility) => new VisibilityObject(visibility.Id, visibility.DisplayName));
}));
}
}
}
using Coscine.ApiCommons.Models;
using Coscine.Configuration;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class DisciplineModel : DatabaseModel<Discipline>
{
public DisciplineModel() : base(Program.Configuration)
{
}
public override Expression<Func<Discipline, Guid>> GetIdFromObject()
{
return (discipline) => discipline.Id;
}
public override ITable<Discipline> GetITableFromDatabase(CoscineDB db)
{
return db.Disciplines;
}
public override void SetObjectId(Discipline databaseObject, Guid id)
{
databaseObject.Id = id;
}
}
}
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class GitlabResourceTypeModel : DatabaseModel<GitlabResourceType>
{
public GitlabResourceTypeModel() : base(Program.Configuration)
{
}
public override Expression<Func<GitlabResourceType, Guid>> GetIdFromObject()
{
return (gitlabResourceType) => gitlabResourceType.Id;
}
public override ITable<GitlabResourceType> GetITableFromDatabase(CoscineDB db)
{
return db.GitlabResourceTypes;
}
public override void SetObjectId(GitlabResourceType databaseObject, Guid id)
{
databaseObject.Id = id;
}
}
}
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class InstituteModel : DatabaseModel<Institute>
{
public InstituteModel() : base(Program.Configuration)
{
}
public override Expression<Func<Institute, Guid>> GetIdFromObject()
{
return (institute) => institute.Id;
}
public override ITable<Institute> GetITableFromDatabase(CoscineDB db)
{
return db.Institutes;
}
public override void SetObjectId(Institute databaseObject, Guid id)
{
databaseObject.Id = id;
}
}
}
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class LicenseModel : DatabaseModel<License>
{
public LicenseModel() : base(Program.Configuration)
{
}
public override System.Linq.Expressions.Expression<Func<License, Guid>> GetIdFromObject()
{
return (license) => license.Id;
}
public override LinqToDB.ITable<License> GetITableFromDatabase(CoscineDB db)
{
return db.Licenses;
}
public override void SetObjectId(License databaseObject, Guid id)
{
databaseObject.Id = id;
}
}
}
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class ProjectDisciplineModel : DatabaseModel<ProjectDiscipline>
{
public ProjectDisciplineModel() : base(Program.Configuration)
{
}
public override Expression<Func<ProjectDiscipline, Guid>> GetIdFromObject()
{
return (projectDiscipline) => projectDiscipline.RelationId;
}
public override ITable<ProjectDiscipline> GetITableFromDatabase(CoscineDB db)
{
return db.ProjectDisciplines;
}
public override void SetObjectId(ProjectDiscipline databaseObject, Guid id)
{
databaseObject.RelationId = id;
}
}
}
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class ProjectInstituteModel : DatabaseModel<ProjectInstitute>
{
public ProjectInstituteModel() : base(Program.Configuration)
{
}
public override Expression<Func<ProjectInstitute, Guid>> GetIdFromObject()
{
return (projectInstitute) => projectInstitute.RelationId;
}
public override ITable<ProjectInstitute> GetITableFromDatabase(CoscineDB db)
{
return db.ProjectInstitutes;
}
public override void SetObjectId(ProjectInstitute databaseObject, Guid id)
{
databaseObject.RelationId = id;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Coscine.Api.Project.ReturnObjects;
......@@ -17,20 +18,74 @@ namespace Coscine.Api.Project.Models
public Coscine.Database.Model.Project StoreFromObject(ProjectObject projectObject, User user)
{
if(projectObject.Disciplines.Count() == 0 || projectObject.Institutes.Count() == 0)
{
throw new ArgumentException("Discipline and Institute are necessary!");
}
Coscine.Database.Model.Project project = new Coscine.Database.Model.Project()
{
Description = projectObject.Description,
DisplayName = projectObject.DisplayName,
Organization = projectObject.Organization,
StartDate = projectObject.StartDate,
EndDate = projectObject.EndDate,
Keywords = projectObject.Keywords,
ProjectName = projectObject.ProjectName,
PrincipleInvestigators = projectObject.PrincipleInvestigators,
GrantId = projectObject.GrantId,
VisibilityId = projectObject.Visibility.Id,
};
Insert(project);
try
{
SetDisciplines(project, projectObject.Disciplines);
SetInstitutes(project, projectObject.Institutes);
}
catch (Exception e)
{
Delete(project);
throw e;
}
SetOwner(project, user);
return project;
}
private void SetDisciplines(Database.Model.Project project, IEnumerable<DisciplineObject> disciplines)
{
ProjectDisciplineModel projectDisciplineModel = new ProjectDisciplineModel();
foreach(var oldDiscipline in projectDisciplineModel.GetAllWhere((projectDiscipline) => projectDiscipline.ProjectId == project.Id))
{
projectDisciplineModel.Delete(oldDiscipline);
}
foreach (var discipline in disciplines)
{
projectDisciplineModel.Insert(new ProjectDiscipline()
{
ProjectId = project.Id,
DisciplineId = discipline.Id
});
}
}
private void SetInstitutes(Database.Model.Project project, IEnumerable<InstituteObject> institutes)
{
ProjectInstituteModel projectInstituteModel = new ProjectInstituteModel();
foreach (var oldInstitute in projectInstituteModel.GetAllWhere((projectInstitute) => projectInstitute.ProjectId == project.Id))
{
projectInstituteModel.Delete(oldInstitute);
}
foreach (var institute in institutes)
{
projectInstituteModel.Insert(new ProjectInstitute()
{
ProjectId = project.Id,
InstituteId = institute.Id
});
}
}
public ProjectRole SetOwner(Coscine.Database.Model.Project project, User user)
{
ProjectRoleModel projectRoleModel = new ProjectRoleModel();
......@@ -48,13 +103,18 @@ namespace Coscine.Api.Project.Models
}
public bool CanSeeProject(User user, Coscine.Database.Model.Project project)
{
return IsMemberOrHigher(user, project);
}
public bool IsMemberOrHigher(User user, Coscine.Database.Model.Project project)
{
return DatabaseConnection.ConnectToDatabase((db) => (from relation in db.ProjectRoles
where relation.Project == project
&& relation.User == user
&& (relation.Role.DisplayName == "Owner"
|| relation.Role.DisplayName == "Member")
select relation).Any());
where relation.Project == project
&& relation.User == user
&& (relation.Role.DisplayName == "Owner"
|| relation.Role.DisplayName == "Member")
select relation).Any());
}
public bool OwnsProject(User user, Coscine.Database.Model.Project project)
......@@ -83,16 +143,66 @@ namespace Coscine.Api.Project.Models
public int UpdateByObject(Database.Model.Project project, ProjectObject projectObject)
{
if (projectObject.Disciplines.Count() == 0 || projectObject.Institutes.Count() == 0)
{
throw new ArgumentException("Discipline and Institute are necessary!");
}
project.Description = projectObject.Description;
project.DisplayName = projectObject.DisplayName;
project.Organization = projectObject.Organization;
project.StartDate = projectObject.StartDate;
project.EndDate = projectObject.EndDate;
project.Keywords = projectObject.Keywords;
project.ProjectName = projectObject.ProjectName;
project.PrincipleInvestigators = projectObject.PrincipleInvestigators;
project.GrantId = projectObject.GrantId;
SetDisciplines(project, projectObject.Disciplines);
SetInstitutes(project, projectObject.Institutes);
project.VisibilityId = projectObject.Visibility.Id;
return Update(project);
}
public ProjectObject CreateReturnObjectFromDatabaseObject(Database.Model.Project project, Guid parentId = new Guid())
{
IEnumerable<DisciplineObject> disciplines = new List<DisciplineObject>();
if(project.ProjectDisciplineProjectIdIds == null)
{
DisciplineModel disciplineModel = new DisciplineModel();
disciplines = disciplineModel.GetAllWhere((discipline) => (from relation in discipline.ProjectDisciplineDisciplineIdIds where relation.ProjectId == project.Id select relation).Any())
.Select((discipline) => new DisciplineObject(discipline.Id, discipline.Url, discipline.DisplayName));
}
else
{
disciplines = project.ProjectDisciplineProjectIdIds.Select((discipline) => new DisciplineObject(discipline.Discipline.Id, discipline.Discipline.Url, discipline.Discipline.DisplayName));
}
IEnumerable<InstituteObject> institutes = new List<InstituteObject>();
if (project.ProjectInstituteProjectIdIds == null)
{
InstituteModel instituteModel = new InstituteModel();
institutes = instituteModel.GetAllWhere((institute) => (from relation in institute.ProjectInstituteInstituteIdIds where relation.ProjectId == project.Id select relation).Any())
.Select((institute) => new InstituteObject(institute.Id, institute.IKZ, institute.DisplayName));
}
else
{
institutes = project.ProjectInstituteProjectIdIds.Select((institute) => new InstituteObject(institute.Institute.Id, institute.Institute.IKZ, institute.Institute.DisplayName));
}
if (project.Visibility == null && project.VisibilityId.HasValue)
{
VisibilityModel visibilityModel = new VisibilityModel();
project.Visibility = visibilityModel.GetById(project.VisibilityId.Value);
}
return new ProjectObject(project.Id, project.Description, project.DisplayName, project.StartDate, project.EndDate, project.Keywords,
project.ProjectName, project.PrincipleInvestigators, project.GrantId,
disciplines,
institutes,
project.Visibility == null ? null : new VisibilityObject(project.Visibility.Id, project.Visibility.DisplayName),
parentId);
}
public override Expression<Func<Database.Model.Project, Guid>> GetIdFromObject()
{
return databaseObject => databaseObject.Id;
......
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class RDSResourceTypeModel : DatabaseModel<RDSResourceType>
{
public RDSResourceTypeModel() : base(Program.Configuration)
{
}
public override Expression<Func<RDSResourceType, Guid>> GetIdFromObject()
{
return (rdsResourceType) => rdsResourceType.Id;
}
public override ITable<RDSResourceType> GetITableFromDatabase(CoscineDB db)
{
return db.RDSResourceTypes;
}
public override void SetObjectId(RDSResourceType databaseObject, Guid id)
{
databaseObject.Id = id;
}
}
}
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class ResourceDisciplineModel : DatabaseModel<ResourceDiscipline>
{
public ResourceDisciplineModel() : base(Program.Configuration)
{
}
public override Expression<Func<ResourceDiscipline, Guid>> GetIdFromObject()
{
return (resourceDiscipline) => resourceDiscipline.RelationId;
}
public override ITable<ResourceDiscipline> GetITableFromDatabase(CoscineDB db)
{
return db.ResourceDisciplines;
}
public override void SetObjectId(ResourceDiscipline databaseObject, Guid id)
{
databaseObject.RelationId = id;
}
}
}
This diff is collapsed.
using Coscine.ApiCommons.Models;
using Coscine.Database.Model;
using LinqToDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Coscine.Api.Project.Models
{
public class VisibilityModel : DatabaseModel<Visibility>
{
public VisibilityModel() : base(Program.Configuration)
{
}
public override Expression<Func<Visibility, Guid>> GetIdFromObject()
{
return (visibility) => visibility.Id;
}
public override ITable<Visibility> GetITableFromDatabase(CoscineDB db)
{
return db.Visibilities;
}
public override void SetObjectId(Visibility databaseObject, Guid id)
{
databaseObject.Id = id;
}
}
}
......@@ -54,8 +54,8 @@
<Reference Include="Coscine.Configuration, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Configuration.1.4.0\lib\net461\Coscine.Configuration.dll</HintPath>
</Reference>
<Reference Include="Coscine.Database, Version=1.5.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.5.0\lib\net461\Coscine.Database.dll</HintPath>
<Reference Include="Coscine.Database, Version=1.6.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.6.0\lib\net461\Coscine.Database.dll</HintPath>
</Reference>
<Reference Include="Coscine.ProxyApi, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.ProxyApi.1.2.0\lib\net461\Coscine.ProxyApi.dll</HintPath>
......@@ -567,22 +567,41 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\DataSourceController.cs" />
<Compile Include="Controllers\VisibilityController.cs" />
<Compile Include="Controllers\InstituteController.cs" />
<Compile Include="Controllers\DisciplineController.cs" />
<Compile Include="Controllers\ProjectController.cs" />
<Compile Include="Controllers\ResourceController.cs" />
<Compile Include="Controllers\ResourceTypeController.cs" />
<Compile Include="Controllers\RoleController.cs" />
<Compile Include="Controllers\SubProjectController.cs" />
<Compile Include="Controllers\ProjectRoleController.cs" />
<Compile Include="Models\DisciplineModel.cs" />
<Compile Include="Models\GitlabResourceTypeModel.cs" />
<Compile Include="Models\InstituteModel.cs" />
<Compile Include="Models\LicenseModel.cs" />
<Compile Include="Models\ProjectDisciplineModel.cs" />
<Compile Include="Models\ProjectInstituteModel.cs" />
<Compile Include="Models\ProjectModel.cs" />
<Compile Include="Models\ProjectResourceModel.cs" />
<Compile Include="Models\ProjectRoleModel.cs" />
<Compile Include="Models\RDSResourceTypeModel.cs" />
<Compile Include="Models\ResourceDisciplineModel.cs" />
<Compile Include="Models\ResourceModel.cs" />
<Compile Include="Models\ResourceTypeModel.cs" />
<Compile Include="Models\RoleModel.cs" />
<Compile Include="Models\SubProjectModel.cs" />
<Compile Include="Models\UserModel.cs" />
<Compile Include="Models\VisibilityModel.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReturnObjects\GitlabResourceTypeObject.cs" />
<Compile Include="ReturnObjects\LicenseObject.cs" />
<Compile Include="ReturnObjects\RDSResourceTypeObject.cs" />
<Compile Include="ReturnObjects\ResourceTypeOptionObject.cs" />
<Compile Include="ReturnObjects\VisibilityObject.cs" />
<Compile Include="ReturnObjects\InstituteObject.cs" />
<Compile Include="ReturnObjects\DisciplineObject.cs" />
<Compile Include="ReturnObjects\ProjectObject.cs" />
<Compile Include="ReturnObjects\ProjectRoleObject.cs" />
<Compile Include="ReturnObjects\ResourceObject.cs" />
......
......@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("Project is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("Project")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyInformationalVersion("1.4.0.0")]
[assembly: AssemblyCopyright("2019 IT Center, RWTH Aachen University")]
using Coscine.ApiCommons.ReturnObjects;
using Coscine.Database.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;