Skip to content

Commit

Permalink
launcher can manage team in cite (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-tspencer committed May 13, 2024
1 parent c07f1d0 commit 20576c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Blueprint.Api/Cite.Api.Client/Cite.Api.Contracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4306,6 +4306,9 @@ public partial class TeamUser
[System.Text.Json.Serialization.JsonPropertyName("canSubmit")]
public bool CanSubmit { get; set; }

[System.Text.Json.Serialization.JsonPropertyName("canManageTeam")]
public bool CanManageTeam { get; set; }

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v13.0.0.0))")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public static async Task CreateTeamsAsync(MselEntity msel, CiteApiClient citeApi
// create Cite TeamUsers
var isObserver = await blueprintContext.UserTeamRoles
.AnyAsync(umr => umr.UserId == user.Id && umr.TeamId == team.Id && umr.Role == TeamRole.Observer);
var canManageTeam = msel.CreatedBy == user.Id;
var canIncrement = await blueprintContext.UserTeamRoles
.AnyAsync(umr => umr.UserId == user.Id && umr.TeamId == team.Id && umr.Role == TeamRole.Incrementer);
var canModify = await blueprintContext.UserTeamRoles
Expand All @@ -147,7 +148,8 @@ public static async Task CreateTeamsAsync(MselEntity msel, CiteApiClient citeApi
IsObserver = isObserver,
CanIncrementMove = canIncrement,
CanModify = canModify,
CanSubmit = canSubmit
CanSubmit = canSubmit,
CanManageTeam = canManageTeam
};
try
{
Expand Down

0 comments on commit 20576c5

Please sign in to comment.