mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: multiple vulnerabilities
This commit is contained in:
@@ -124,10 +124,7 @@ namespace SharpbinV3.Server.Controllers
|
||||
var actorIsAdmin = actorUser.Roles.HasFlag(Role.Admin);
|
||||
var isSelfUpdate = targetUser.UUID == actorUser.UUID;
|
||||
|
||||
if (
|
||||
(targetUser.Roles.HasFlag(Role.Admin) && !actorIsAdmin)
|
||||
|| (!actorIsAdmin && !isSelfUpdate)
|
||||
)
|
||||
if ((targetUser.Roles.HasFlag(Role.Admin) && !actorIsAdmin) || (!actorIsAdmin && !isSelfUpdate))
|
||||
return StatusCode(403, new { success = false, message = "You do not have permission to modify this user." });
|
||||
|
||||
if ((updatedUser.Roles.HasValue || updatedUser.IsBanned.HasValue) && !actorIsAdmin)
|
||||
|
||||
Reference in New Issue
Block a user