Skip to content

Commit acd0809

Browse files
fix(admin): do not allow to modify anther sudo admin
1 parent e204ad1 commit acd0809

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/operation/admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ async def modify_admin(
4343
) -> AdminDetails:
4444
"""Modify an existing admin's details."""
4545
db_admin = await self.get_validated_admin(db, username=username)
46-
if self.operator_type != OperatorType.CLI and db_admin.username == current_admin.username and db_admin.is_sudo:
46+
if self.operator_type != OperatorType.CLI and db_admin.is_sudo:
4747
await self.raise_error(
48-
message="You're not allowed to edit another sudoer's account. Use pasarguard-cli instead.", code=403
48+
message="You're not allowed to modify another sudoer's account. Use pasarguard-cli instead.", code=403
4949
)
5050

5151
db_admin = await update_admin(db, db_admin, modified_admin)

0 commit comments

Comments
 (0)