use of com.yahoo.elide.core.security.checks.FilterExpressionCheck in project elide by yahoo.
the class PermissionToFilterExpressionVisitor method visitCheckExpression.
@Override
public FilterExpression visitCheckExpression(CheckExpression checkExpression) {
Check check = checkExpression.getCheck();
if (check instanceof FilterExpressionCheck) {
FilterExpressionCheck filterCheck = (FilterExpressionCheck) check;
FilterExpression filterExpression = filterCheck.getFilterExpression(entityClass, requestScope);
if (filterExpression == null) {
throw new IllegalStateException("FilterCheck#getFilterExpression must not return null.");
}
return filterExpression;
}
if (check instanceof UserCheck) {
boolean userCheckResult = ((UserCheck) check).ok(requestScope.getUser());
return userCheckResult ? TRUE_USER_CHECK_EXPRESSION : FALSE_USER_CHECK_EXPRESSION;
}
return NO_EVALUATION_EXPRESSION;
}
Aggregations