Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
apis
Project
Commits
4a610113
Commit
4a610113
authored
Mar 16, 2020
by
Marcel Nellesen
Browse files
Merge branch 'Sprint/2020-04' into 'master'
Sprint/2020-04 See merge request coscine/api/project!76
parents
6531dd74
3736db93
Changes
6
Pipelines
7
Hide whitespace changes
Inline
Side-by-side
src/Project.Tests/Project.Tests.csproj
View file @
4a610113
...
...
@@ -59,8 +59,8 @@
<Reference
Include=
"Coscine.Action, Version=1.10.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.10.0\lib\net461\Coscine.Action.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ApiCommons, Version=1.6.
0
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.6.
0
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
<Reference
Include=
"Coscine.ApiCommons, Version=1.6.
3
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.6.
3
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
</Reference>
<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>
...
...
src/Project.Tests/packages.config
View file @
4a610113
...
...
@@ -5,7 +5,7 @@
<
package
id
=
"Castle.Core"
version
=
"4.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Consul"
version
=
"0.7.2.6"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.10.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.6.
0
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.6.
3
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.16.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Logging"
version
=
"1.0.1"
targetFramework
=
"net472"
/>
...
...
src/Project/Controllers/ProjectController.cs
View file @
4a610113
...
...
@@ -37,8 +37,7 @@ namespace Coscine.Api.Project.Controllers
return
Ok
(
_projectModel
.
GetWithAccess
(
user
,
UserRoles
.
Member
,
UserRoles
.
Owner
).
ToList
()
.
Select
((
project
)
=>
_projectModel
.
CreateReturnObjectFromDatabaseObject
(
project
))
.
OrderBy
(
element
=>
element
.
DisplayName
)
);
);
}
[
HttpGet
(
"[controller]/{id}"
)]
...
...
@@ -124,13 +123,16 @@ namespace Coscine.Api.Project.Controllers
public
void
DeleteProject
(
Database
.
DataModel
.
Project
project
,
bool
isHard
=
false
,
bool
propegateAction
=
true
)
{
var
subProjectModel
=
new
SubProjectModel
();
foreach
(
var
subProject
in
subProjectModel
.
GetAllWhere
((
subProject
)
=>
subProject
.
ProjectId
==
project
.
Id
))
foreach
(
var
subProject
in
subProjectModel
.
GetAllWhere
(
(
subProject
)
=>
subProject
.
ProjectId
==
project
.
Id
&&
(
subProject
.
SubProject_FK
.
Deleted
==
false
||
isHard
)
))
{
Database
.
DataModel
.
Project
subProjectObject
;
if
(
isHard
)
{
subProjectModel
.
Delete
(
subProject
);
subProjectObject
=
_projectModel
.
GetByIdIncludingDeleted
(
subProject
.
SubProjectId
);
subProjectModel
.
Delete
(
subProject
);
}
else
{
...
...
src/Project/Controllers/SubProjectController.cs
View file @
4a610113
...
...
@@ -35,7 +35,7 @@ namespace Coscine.Api.Project.Controllers
var
subProjects
=
_subProjectModel
.
GetAllWhere
((
subProjectM
)
=>
(
subProjectM
.
ProjectId
==
parentGuid
// Corrosponing subproject must exist
&&
subProjectM
.
Project
.
Deleted
==
false
&&
subProjectM
.
Sub
Project
_FK
.
Deleted
==
false
// select only subprojects to which the user has access
&&
(
from
projectRole
in
subProjectM
.
SubProject_FK
.
ProjectRolesProjectIdIds
...
...
src/Project/Project.csproj
View file @
4a610113
...
...
@@ -52,8 +52,8 @@
<Reference
Include=
"Coscine.Action, Version=1.10.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.10.0\lib\net461\Coscine.Action.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ApiCommons, Version=1.6.
0
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.6.
0
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
<Reference
Include=
"Coscine.ApiCommons, Version=1.6.
3
.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.6.
3
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
</Reference>
<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>
...
...
src/Project/packages.config
View file @
4a610113
...
...
@@ -5,7 +5,7 @@
<
package
id
=
"Castle.Core"
version
=
"4.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Consul"
version
=
"0.7.2.6"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.10.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.6.
0
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.6.
3
"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.4.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.16.0"
targetFramework
=
"net472"
/>
<
package
id
=
"Coscine.Logging"
version
=
"1.0.1"
targetFramework
=
"net472"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment