Skip to content

Commit

Permalink
Permissions fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Sep 13, 2024
1 parent db28b84 commit ced3419
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Gameboard.Api/Features/Game/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public Task<Game> ImportGameSpec([FromBody] GameSpecImport model)
[HttpPost("/api/game/export")]
public async Task<string> ExportGameSpec([FromBody] GameSpecExport model)
{
await _permissionsService.Can(PermissionKey.Games_CreateEditDelete);
await Authorize(_permissionsService.Can(PermissionKey.Games_CreateEditDelete));
return await GameService.Export(model);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@ namespace Gameboard.Api.Features.Games;

public record GetSyncStartStateQuery(string GameId, User ActingUser) : IRequest<SyncStartState>;

internal class GetSyncStartStateQueryHandler : IRequestHandler<GetSyncStartStateQuery, SyncStartState>
internal class GetSyncStartStateQueryHandler(
ISyncStartGameService syncStartGameService,
IGameboardRequestValidator<GetSyncStartStateQuery> validator
) : IRequestHandler<GetSyncStartStateQuery, SyncStartState>
{
private readonly ISyncStartGameService _syncStartGameService;
private readonly IGameboardRequestValidator<GetSyncStartStateQuery> _validator;

public GetSyncStartStateQueryHandler
(
ISyncStartGameService syncStartGameService,
IGameboardRequestValidator<GetSyncStartStateQuery> validator
)
{
_syncStartGameService = syncStartGameService;
_validator = validator;
}
private readonly ISyncStartGameService _syncStartGameService = syncStartGameService;
private readonly IGameboardRequestValidator<GetSyncStartStateQuery> _validator = validator;

public async Task<SyncStartState> Handle(GetSyncStartStateQuery request, CancellationToken cancellationToken)
{
Expand Down

0 comments on commit ced3419

Please sign in to comment.