Extended role-based access in MaterialController to include additional roles.
This commit is contained in:
parent
932b42d926
commit
f75b20830c
1 changed files with 2 additions and 2 deletions
|
|
@ -37,7 +37,7 @@ public class MaterialController {
|
|||
* X-Total-Count (total elements), X-Page-Count (total pages), and X-Current-Page (current page).
|
||||
*/
|
||||
@GetMapping("/")
|
||||
@PreAuthorize("hasRole('SUPER')")
|
||||
@PreAuthorize("hasAnyRole('SUPER', 'CALCULATION', 'BASIC', 'FREIGHT', 'PACKAGING')")
|
||||
public ResponseEntity<List<MaterialDTO>> listMaterials(
|
||||
@RequestParam(defaultValue = "true") String excludeDeprecated,
|
||||
@RequestParam(defaultValue = "20") @Min(1) int limit,
|
||||
|
|
@ -61,7 +61,7 @@ public class MaterialController {
|
|||
* @throws RuntimeException if the material with the given ID is not found.
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("hasRole('SUPER')")
|
||||
@PreAuthorize("hasAnyRole('SUPER', 'CALCULATION', 'BASIC', 'FREIGHT', 'PACKAGING')")
|
||||
public ResponseEntity<MaterialDetailDTO> getMaterialDetails(@PathVariable Integer id) {
|
||||
return ResponseEntity.ok(materialService.getMaterial(id));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue