Feature/Auth: last one was authentication, this one is authorization #4
@@ -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) {
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user