private Object evaluateRoleExpression ( ActionBean bean , String expression ) { try { LOG . debug ( "Evaluating expression: '" + expression + ' ' ) ; // This is somewhat of a hack until the ExpressionEvaluator becomes more accessible. ParameterName name = new ParameterName ( "security" ) ; List < Object > values = new ArrayList < Object > ( ) ; values . add ( null ) ; ValidationMetadata metadata = new ValidationMetadata ( "security" ) . expression ( expression ) ; ValidationErrors errors = new ValidationErrors ( ) ; ExpressionValidator . evaluate ( bean , name , values , metadata , errors ) ; return errors . isEmpty ( ) ; } catch ( Exception exc ) { throw new StripesRuntimeException ( exc ) ; } }
Evaluate the given EL expression using the current action bean to resolve variables .