Feature/Auth: last one was authentication, this one is authorization #4

Merged
homeburger merged 33 commits from feature/auth into main 2026-04-23 00:18:39 -05:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 143d194cdb - Show all commits

View File

@@ -20,7 +20,7 @@ public class UsersController : ControllerBase {
service_ = service;
}
[Authorize(Policy = "RequireAdmin")]
[Authorize(Policy = "SensitiveDataRead")]
[HttpGet]
public async Task<ActionResult<List<User>>> getUsers() {
List<User> rawArray = await service_.GetAll();
@@ -42,7 +42,7 @@ public class UsersController : ControllerBase {
return Ok(dtoArray);
}
[Authorize(Policy = "RequireAdmin")]
[Authorize(Policy = "SensitiveDataRead")]
[HttpGet("{id:int}")]
public async Task<ActionResult<User>> getUser(int id) {
@@ -60,7 +60,7 @@ public class UsersController : ControllerBase {
return Ok(newDto);
}
[Authorize(Policy = "RequireSuperuser")]
[Authorize(Policy = "SensitiveDataModify")]
[HttpDelete("{id}")]
public async Task<ActionResult> deleteUser(int id) {

View File

@@ -13,7 +13,8 @@ To see live logs:
sudo docker logs -f -t agologum-api
public user:
> username=bard
> username=bard (admin)
> username=xvbard (superuser)
> password=Public*890
chrome dev tools troubleshooting