allow removal of self permissions, just not the important one
All checks were successful
Build and Deploy API / build-and-deploy (push) Successful in 8s
All checks were successful
Build and Deploy API / build-and-deploy (push) Successful in 8s
This commit is contained in:
@@ -70,8 +70,7 @@ public class UsersController : ControllerBase {
|
|||||||
[HttpDelete("{id}/{permission}")]
|
[HttpDelete("{id}/{permission}")]
|
||||||
public async Task<ActionResult> removePermission(string id, string permission) {
|
public async Task<ActionResult> removePermission(string id, string permission) {
|
||||||
|
|
||||||
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
if(permission == Permission.SensitiveData_Modify) return BadRequest(); // dont allow permission removal of whats allowing us to re-add premissions
|
||||||
if(userId == id) return BadRequest(); // dont allow permission removal of yourself
|
|
||||||
|
|
||||||
// get list of permissions of that user
|
// get list of permissions of that user
|
||||||
var user = await service_.GetById(id);
|
var user = await service_.GetById(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user