Fixed unSudo
All checks were successful
/ Build the server (push) Successful in 2m28s

This commit is contained in:
Mutzi 2024-08-31 22:12:42 +02:00
parent b9e97f6fbd
commit 5306a1e682
Signed by: root
GPG Key ID: 2437494E09F13876

View File

@ -27,7 +27,11 @@ public class Token implements Authentication {
public boolean isAdmin() { return (sudoRealUser != null) || user.admin; }
public User getRealUser() { return sudoRealUser != null ? sudoRealUser : user; }
public void unSudo() { if (sudoRealUser != null) user = sudoRealUser; }
public void unSudo() {
if (sudoRealUser != null)
user = sudoRealUser;
sudoRealUser = null;
}
public void sudo(@NonNull User newUser) {
if (this.sudoRealUser == null) sudoRealUser = user;