Skip to content

Commit

Permalink
New project managers also gain CreateProject rights (#753)
Browse files Browse the repository at this point in the history
If the admin accepts the project creation request and creates the draft
project, the new project manager should also gain CreateProject rights
just like existing managers have.
  • Loading branch information
rmunn authored Apr 23, 2024
1 parent 197546c commit cd81e47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/LexBoxApi/Services/ProjectService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public async Task<Guid> CreateProject(CreateProjectInput input)
});
// Also delete draft project, if any
await dbContext.DraftProjects.Where(dp => dp.Id == projectId).ExecuteDeleteAsync();
if (input.ProjectManagerId.HasValue)
{
var manager = await dbContext.Users.FindAsync(input.ProjectManagerId.Value);
manager?.UpdateCreateProjectsPermission(ProjectRole.Manager);

}
await dbContext.SaveChangesAsync();
await hgService.InitRepo(input.Code);
await transaction.CommitAsync();
Expand Down

0 comments on commit cd81e47

Please sign in to comment.