Skip to content
Snippets Groups Projects
Commit 46b917af authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: toString is overwritten by subclassses; use realm and username directly

parent a1958516
Branches
Tags
1 merge request!65F permission checks
Pipeline #26097 passed
......@@ -49,6 +49,7 @@ import org.caosdb.api.entity.v1.MessageCode;
import org.caosdb.datetime.UTCDateTime;
import org.caosdb.server.CaosDBServer;
import org.caosdb.server.ServerProperties;
import org.caosdb.server.accessControl.Principal;
import org.caosdb.server.caching.Cache;
import org.caosdb.server.database.access.Access;
import org.caosdb.server.database.backend.implementation.MySQL.ConnectionException;
......@@ -1007,7 +1008,11 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
String getCacheKey() {
final StringBuilder sb = new StringBuilder();
if (this.user != null) {
sb.append(this.user.getPrincipal().toString());
String principal_desc =
((Principal) this.user.getPrincipal()).getUsername()
+ Principal.REALM_SEPARATOR
+ ((Principal) this.user.getPrincipal()).getRealm();
sb.append(principal_desc);
}
if (this.versioned) {
sb.append("versioned");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment