class SpringSecurityExpressionObjectFactory implements IExpressionObjectFactory {


    /*
     * Any new objects added here should also be added to the "ALL_EXPRESSION_OBJECT_NAMES" See below.
     */

    public static final String AUTHENTICATION_EXPRESSION_OBJECT_NAME = "authentication";
    public static final String AUTHORIZATION_EXPRESSION_OBJECT_NAME = "authorization";




    protected static final Set<String> ALL_EXPRESSION_OBJECT_NAMES =
            Collections.unmodifiableSet(new LinkedHashSet<String>(java.util.Arrays.asList(
                    new String[]{
                            AUTHENTICATION_EXPRESSION_OBJECT_NAME,
                            AUTHORIZATION_EXPRESSION_OBJECT_NAME
                    }
            )));




    public SpringSecurityExpressionObjectFactory() {
        super();
    }




    public Set<String> getAllExpressionObjectNames() {
        return ALL_EXPRESSION_OBJECT_NAMES;
    }



    public boolean isCacheable(final String expressionObjectName) {
        // All expression objects created by this factory are cacheable (template-scope)
        return true;
    }



    public Object buildObject(final IExpressionContext context, final String expressionObjectName) {<FILL_FUNCTION_BODY>}


}


        if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            if (SpringVersionSpecificUtils.isWebContext(context)) {
                return AuthUtils.getAuthenticationObject(context);
            }
        }

        if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
            if (SpringVersionSpecificUtils.isWebContext(context)) {

                // We retrieve it like this in order to give it the opportunity to come from cache
                final Authentication authentication =
                        (Authentication) context.getExpressionObjects().getObject(AUTHENTICATION_EXPRESSION_OBJECT_NAME);

                return new Authorization(context, authentication);

            }
            return null;
        }

        return null;

    
<no_super_class>