class AuthorizeAclAttrProcessor extends AbstractStandardConditionalVisibilityTagProcessor {


    public static final int ATTR_PRECEDENCE = 300;
    public static final String ATTR_NAME = "authorize-acl";


    private static final String VALUE_SEPARATOR = "::";



    public AuthorizeAclAttrProcessor(final TemplateMode templateMode, final String dialectPrefix) {
        super(templateMode, dialectPrefix, ATTR_NAME, ATTR_PRECEDENCE);
    }



    @Override
    protected boolean isVisible(
            final ITemplateContext context, final IProcessableElementTag tag,
            final AttributeName attributeName, final String attributeValue) {<FILL_FUNCTION_BODY>}





    protected static IStandardExpression getExpressionDefaultToLiteral(
            final IStandardExpressionParser expressionParser, final IExpressionContext context, final String input) {

        final IStandardExpression expression = expressionParser.parseExpression(context, input);
        if (expression == null) {
            return new TextLiteralExpression(input);
        }
        return expression;

    }


}


        final String attrValue = (attributeValue == null? null : attributeValue.trim());

        if (attrValue == null || attrValue.length() == 0) {
            return false;
        }

        final Authentication authentication = AuthUtils.getAuthenticationObject(context);
        if (authentication == null) {
            return false;
        }

        final ApplicationContext applicationContext = AuthUtils.getContext(context);

        final IEngineConfiguration configuration = context.getConfiguration();

        final int separatorPos = attrValue.lastIndexOf(VALUE_SEPARATOR);
        if (separatorPos == -1) {
            throw new TemplateProcessingException(
                    "Could not parse \"" + attributeValue + "\" as an access control list " +
                            "expression. Syntax should be \"[domain object expression] :: [permissions]\"");
        }

        final String domainObjectExpression = attrValue.substring(0,separatorPos).trim();
        final String permissionsExpression = attrValue.substring(separatorPos + 2).trim();

        final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);

        final IStandardExpression domainObjectExpr =
                getExpressionDefaultToLiteral(expressionParser, context, domainObjectExpression);
        final IStandardExpression permissionsExpr =
                getExpressionDefaultToLiteral(expressionParser, context, permissionsExpression);

        final Object domainObject = domainObjectExpr.execute(context);

        final Object permissionsObject = permissionsExpr.execute(context);
        final String permissionsStr =
                (permissionsObject == null? null : permissionsObject.toString());

        return AclAuthUtils.authorizeUsingAccessControlList(
                context, domainObject, applicationContext, permissionsStr, authentication);

    
<no_super_class>