From 41f5f225743c0a87ed5dbdaa438e86a47d50ae44 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Wed, 31 Aug 2016 12:29:29 +0200 Subject: [PATCH] [Minor] Allow to override privilegeValue in StrolchElementQuery use this together with the value "internal" to define queries as internal, so you can make them executable without having to allow all queries --- .../java/li/strolch/runtime/StrolchConstants.java | 2 ++ .../li/strolch/model/query/StrolchElementQuery.java | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/li.strolch.agent/src/main/java/li/strolch/runtime/StrolchConstants.java b/li.strolch.agent/src/main/java/li/strolch/runtime/StrolchConstants.java index 286b5add3..94b82256a 100644 --- a/li.strolch.agent/src/main/java/li/strolch/runtime/StrolchConstants.java +++ b/li.strolch.agent/src/main/java/li/strolch/runtime/StrolchConstants.java @@ -100,5 +100,7 @@ public class StrolchConstants { public static final String PRIVILEGE_INVALIDATE_SESSION = "InvalidateSession"; public static final String PRIVILEGE_GET_SESSION = "GetSession"; + + public static final String INTERNAL = "internal"; } } diff --git a/li.strolch.model/src/main/java/li/strolch/model/query/StrolchElementQuery.java b/li.strolch.model/src/main/java/li/strolch/model/query/StrolchElementQuery.java index a86f8cee3..731954a50 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/query/StrolchElementQuery.java +++ b/li.strolch.model/src/main/java/li/strolch/model/query/StrolchElementQuery.java @@ -22,17 +22,24 @@ import li.strolch.utils.dbc.DBC; */ public abstract class StrolchElementQuery implements StrolchQuery { + private String privilegeValue; + protected Navigation navigation; protected Selection selection; public StrolchElementQuery() { - // empty + this.privilegeValue = getClass().getName(); } public StrolchElementQuery(Navigation navigation) { + this(); this.navigation = navigation; } + public void setPrivilegeValue(String privilegeValue) { + this.privilegeValue = privilegeValue; + } + public void setNavigation(Navigation navigation) { this.navigation = navigation; } @@ -110,6 +117,6 @@ public abstract class StrolchElementQuery implements Str */ @Override public Object getPrivilegeValue() { - return getClass().getName(); + return this.privilegeValue; } }