public boolean isAssociationAllowed(JID user) {
        if (associationPolicy == LeafNodeAssociationPolicy.all) {
            // Anyone is allowed to associate leaf nodes with this node
            return true;
        }
        else if (associationPolicy == LeafNodeAssociationPolicy.owners) {
            // Only owners or sysadmins are allowed to associate leaf nodes with this node
            return isAdmin(user);
        }
        else {
            // Owners, sysadmins and a whitelist of users are allowed to
            // associate leaf nodes with this node
            return isAdmin(user) || associationTrusted.contains(user);
        }
    }
Returns true if the specified user is allowed to associate a leaf node with this
node. The decision is taken based on the association policy that the node is
using.

@param user the user trying to associate a leaf node with this node.
@return true if the specified user is allowed to associate a leaf node with this
        node.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/CollectionNode.java