Skip to content

Commit

Permalink
Adds manager access to issue vouchers (#271)
Browse files Browse the repository at this point in the history
Users with role Manager can now (alongside users with role Board) issue
vouchers, which also includes access to the products/all endpoint.
This is required to list products available to issue products on. (This
endpoint is used for issuing vouchers as well as the product manager but
nowhere else. The endpoint for products that is usable per user group
used by the app is a different endpoint)
  • Loading branch information
A-Guldborg authored Mar 14, 2024
1 parent 431eeb6 commit be81595
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task<ActionResult<ProductResponse>> GetProduct([FromRoute(Name = "i
/// <returns>List of all products</returns>
/// <response code="200">Successful request</response>
[HttpGet("all")]
[AuthorizeRoles(UserGroup.Board)]
[AuthorizeRoles(UserGroup.Board, UserGroup.Manager)]
[ProducesResponseType(typeof(IEnumerable<ProductResponse>), StatusCodes.Status200OK)]
public async Task<ActionResult<IEnumerable<ProductResponse>>> GetAllProducts()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public VouchersController(IVoucherService voucherService, IPurchaseService purch
[ProducesResponseType(typeof(ApiError), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
[ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)]
[AuthorizeRoles(UserGroup.Board)]
[AuthorizeRoles(UserGroup.Board, UserGroup.Manager)]
[HttpPost("issue-vouchers")]
public async Task<ActionResult<IEnumerable<IssueVoucherResponse>>> IssueVouchers([FromBody] IssueVoucherRequest request)
{
Expand Down

0 comments on commit be81595

Please sign in to comment.