Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
apis
Project
Merge requests
!159
Product/1548 project invite mngmnt
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Product/1548 project invite mngmnt
Product/1548-projectInviteMngmnt
into
Sprint/2021-12
Overview
0
Commits
2
Pipelines
1
Changes
1
Merged
Petar Hristov
requested to merge
Product/1548-projectInviteMngmnt
into
Sprint/2021-12
4 years ago
Overview
0
Commits
2
Pipelines
1
Changes
1
coscine/issues#1548
coscine/issues#1562
0
0
Merge request reports
Compare
Sprint/2021-12
Sprint/2021-12 (base)
and
latest version
latest version
96be7d0c
2 commits,
4 years ago
1 file
+
13
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Project/Controllers/ProjectController.cs
+
13
−
2
View file @ 96be7d0c
Edit in single-file editor
Open in Web IDE
Show full file
@@ -600,7 +600,7 @@ namespace Coscine.Api.Project.Controllers
return
Unauthorized
(
$"You are not an owner of the project."
);
}
var
invitations
=
_invitationModel
.
GetAllWhere
(
x
=>
x
.
Project
==
projectId
&&
x
.
Expiration
>
DateTime
.
UtcNow
)
var
invitations
=
_invitationModel
.
GetAllWhere
(
x
=>
x
.
Project
==
projectId
)
.
Select
(
x
=>
new
InvitationReturnObject
{
Id
=
x
.
Id
,
@@ -652,11 +652,22 @@ namespace Coscine.Api.Project.Controllers
x
.
Expiration
>
DateTime
.
UtcNow
);
if
(
invitations
!=
null
&&
invitations
.
Any
())
if
(
invitations
.
Any
())
{
return
BadRequest
(
"This invitee already has a valid invitation to this project."
);
}
var
expiredInvitations
=
_invitationModel
.
GetAllWhere
(
x
=>
x
.
Project
==
sendInvitationObject
.
Project
&&
x
.
InviteeEmail
==
sendInvitationObject
.
Email
&&
x
.
Expiration
<=
DateTime
.
UtcNow
);
foreach
(
var
expiredInvitation
in
expiredInvitations
)
{
_invitationModel
.
Delete
(
expiredInvitation
);
}
var
token
=
_invitationModel
.
CreateInvitation
(
sendInvitationObject
.
Project
,
user
.
Id
,
sendInvitationObject
.
Role
,
sendInvitationObject
.
Email
);
var
body
=
new
JObject
Loading