if (acls[i] instanceof AbstractBasicAclEntry) { AbstractBasicAclEntry processableAcl = (AbstractBasicAclEntry) acls[i];
if (acls[i] instanceof BasicAclEntry) { BasicAclEntry processableAcl = (BasicAclEntry) acls[i];
    public int vote(Authentication authentication, Object object,        ConfigAttributeDefinition config) {        Iterator iter = config.getConfigAttributes();        while (iter.hasNext()) {            ConfigAttribute attr = (ConfigAttribute) iter.next();            if (this.supports(attr)) {                // Need to make an access decision on this invocation                // Attempt to locate the domain object instance to process                Object domainObject = getDomainObjectInstance(object);                // If domain object is null, vote to abstain                if (domainObject == null) {                    return AccessDecisionVoter.ACCESS_ABSTAIN;                }                // Evaluate if we are required to use an inner domain object                if ((internalMethod != null) && !"".equals(internalMethod)) {                    try {                        Class clazz = domainObject.getClass();                        Method method = clazz.getMethod(internalMethod,                                new Class[] {});                        domainObject = method.invoke(domainObject,                                new Object[] {});                    } catch (NoSuchMethodException nsme) {                        throw new AuthorizationServiceException(                            "Object of class '" + domainObject.getClass()                            + "' does not provide the requested internalMethod: "                            + internalMethod);                    } catch (IllegalAccessException iae) {                        if (logger.isDebugEnabled()) {                            logger.debug("IllegalAccessException", iae);                            if (iae.getCause() != null) {                                logger.debug("Cause: "                                    + iae.getCause().getMessage(),                                    iae.getCause());                            }                        }                        throw new AuthorizationServiceException(                            "Problem invoking internalMethod: "                            + internalMethod + " for object: " + domainObject);                    } catch (InvocationTargetException ite) {                        if (logger.isDebugEnabled()) {                            logger.debug("InvocationTargetException", ite);                            if (ite.getCause() != null) {                                logger.debug("Cause: "                                    + ite.getCause().getMessage(),                                    ite.getCause());                            }                        }                        throw new AuthorizationServiceException(                            "Problem invoking internalMethod: "                            + internalMethod + " for object: " + domainObject);                    }                }                // Obtain the ACLs applicable to the domain object                AclEntry[] acls = aclManager.getAcls(domainObject,                        authentication);                // If principal has no permissions for domain object, deny                if ((acls == null) || (acls.length == 0)) {                    return AccessDecisionVoter.ACCESS_DENIED;                }                // Principal has some permissions for domain object, check them                for (int i = 0; i < acls.length; i++) {                    // Locate processable AclEntrys                    if (acls[i] instanceof AbstractBasicAclEntry) {                        AbstractBasicAclEntry processableAcl = (AbstractBasicAclEntry) acls[i];                        // See if principal has any of the required permissions                        for (int y = 0; y < requirePermission.length; y++) {                            if (processableAcl.isPermitted(requirePermission[y])) {                                return AccessDecisionVoter.ACCESS_GRANTED;                            }                        }                    }                }                // No permissions match                return AccessDecisionVoter.ACCESS_DENIED;            }        }        // No configuration attribute matched, so abstain        return AccessDecisionVoter.ACCESS_ABSTAIN;    }