class AuthorizeAccess extends AccessModel {

    AuthorizeAccess() {
    }

    @Override
    public boolean canSubscribe(Node node, JID owner, JID subscriber) {
        return true;
    }

    @Override
    public boolean canAccessItems(Node node, JID owner, JID subscriber) {<FILL_FUNCTION_BODY>}

    @Override
    public String getName() {
        return "authorize";
    }

    @Override
    public PacketError.Condition getSubsriptionError() {
        return PacketError.Condition.not_authorized;
    }

    @Override
    public Element getSubsriptionErrorDetail() {
        return DocumentHelper.createElement(QName.get("not-subscribed",
                "http://jabber.org/protocol/pubsub#errors"));
    }

    @Override
    public boolean isAuthorizationRequired() {
        return true;
    }
}

        // Let node owners and sysadmins always get node items
        if (node.isAdmin(owner)) {
            return true;
        }
        NodeAffiliate nodeAffiliate = node.getAffiliate(owner);
        if  (nodeAffiliate == null) {
            // This is an unknown entity to the node so deny access
            return false;
        }
        // Any subscription of this entity that was approved will give him access
        // to retrieve the node items
        for (NodeSubscription subscription : nodeAffiliate.getSubscriptions()) {
            if (subscription.isActive()) {
                return true;
            }
        }
        // No approved subscription was found so deny access
        return false;
    
<methods>public non-sealed void <init>() ,public abstract boolean canAccessItems(org.jivesoftware.openfire.pubsub.Node, JID, JID) ,public abstract boolean canSubscribe(org.jivesoftware.openfire.pubsub.Node, JID, JID) ,public abstract java.lang.String getName() ,public abstract PacketError.Condition getSubsriptionError() ,public abstract Element getSubsriptionErrorDetail() ,public abstract boolean isAuthorizationRequired() ,public static org.jivesoftware.openfire.pubsub.models.AccessModel valueOf(java.lang.String) <variables>public static final org.jivesoftware.openfire.pubsub.models.AccessModel authorize,public static final org.jivesoftware.openfire.pubsub.models.AccessModel open,public static final org.jivesoftware.openfire.pubsub.models.AccessModel presence,public static final org.jivesoftware.openfire.pubsub.models.AccessModel roster,public static final org.jivesoftware.openfire.pubsub.models.AccessModel whitelist