[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
This commit is contained in:
Robert von Burg 2016-08-31 12:29:29 +02:00
parent d25e7577f7
commit 41f5f22574
2 changed files with 11 additions and 2 deletions

View File

@ -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";
}
}

View File

@ -22,17 +22,24 @@ import li.strolch.utils.dbc.DBC;
*/
public abstract class StrolchElementQuery<T extends QueryVisitor> 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<T extends QueryVisitor> implements Str
*/
@Override
public Object getPrivilegeValue() {
return getClass().getName();
return this.privilegeValue;
}
}