Skip to content

Commit 29876c9

Browse files
committed
rest: Prevent unlisted filterable properties from being used (fix #594)
1 parent 659882e commit 29876c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gemma-rest/src/main/java/ubic/gemma/rest/util/args/FilterArg.java

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ Filters getFilters( FilteringService<O> service ) throws MalformedArgException {
152152
String property = subClause.PROPERTY().getText();
153153
ubic.gemma.persistence.util.Filter.Operator operator;
154154
try {
155+
if ( !service.getFilterableProperties().contains( property ) ) {
156+
throw new IllegalArgumentException( String.format( "The property of %s is unknown", property ) );
157+
}
155158
if ( subClause.operator() != null ) {
156159
operator = operatorToOperator( subClause.operator() );
157160
String requiredValue = scalarToString( subClause.scalar() );

0 commit comments

Comments
 (0)