Skip to content

Commit

Permalink
correct method name fixing compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Nov 21, 2023
1 parent 68f069f commit 0b442d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/LexBoxApi/GraphQL/ProjectMutations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public async Task<IQueryable<ProjectUsers>> ChangeProjectMemberRole(
IPermissionService permissionService,
LexBoxDbContext dbContext)
{
permissionService.AssertCanManagerProjectMemberRole(input.ProjectId, input.UserId);
permissionService.AssertCanManageProjectMemberRole(input.ProjectId, input.UserId);
var projectUser =
await dbContext.ProjectUsers.Include(r => r.User).FirstOrDefaultAsync(u =>
u.ProjectId == input.ProjectId && u.UserId == input.UserId);
Expand Down
2 changes: 1 addition & 1 deletion backend/LexBoxApi/Services/PermissionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void AssertIsAdmin()

public void AssertCanDeleteAccount(Guid userId)
{
if (User is { Role: UserRole.admin } user || user.Id == userId)
if (User is { Role: UserRole.admin } || User?.Id == userId)
return;
throw new UnauthorizedAccessException();
}
Expand Down
2 changes: 1 addition & 1 deletion backend/LexCore/ServiceInterfaces/IPermissionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public interface IPermissionService
ValueTask AssertCanAccessProject(string projectCode);
bool CanManageProject(Guid projectId);
void AssertCanManageProject(Guid projectId);
void AssertCanManagerProjectMemberRole(Guid projectId, Guid userId);
void AssertCanManageProjectMemberRole(Guid projectId, Guid userId);
void AssertIsAdmin();
void AssertCanDeleteAccount(Guid userId);
bool HasProjectCreatePermission();
Expand Down
6 changes: 3 additions & 3 deletions backend/Testing/LexCore/LexAuthUserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class LexAuthUserTests
{
private readonly LexAuthService _lexAuthService = new LexAuthService(
new OptionsWrapper<JwtOptions>(JwtOptions.TestingOptions),
null,
null,
null);
null!,
null!,
null!);

private readonly LexAuthUser _user = new()
{
Expand Down

0 comments on commit 0b442d6

Please sign in to comment.