lib/client.js
function(publicKey, rules, callback) {
        if (!Array.isArray(rules)) {
            rules = [rules];
        }

        if (!publicKey) {
            throw new Error('Public key must be a valid string');
        }

        var url = this.getResourceUrl({ path: '/keys/' + publicKey + '/access', user: null });

        request({
            method: 'POST',
            uri: this.getSignedResourceUrl('POST', url),
            json: rules,
            onComplete: function(err, res, body) {
                callback(err, body, res);
            }
        });

        return this;
    }
function(publicKey, rules, callback) {
        if (!Array.isArray(rules)) {
            rules = [rules];
        }

        if (!publicKey) {
            throw new Error('Public key must be a valid string');
        }

        var url = this.getResourceUrl({ path: '/keys/' + publicKey + '/access', user: null });

        request({
            method: 'POST',
            uri: this.getSignedResourceUrl('POST', url),
            json: rules,
            onComplete: function(err, res, body) {
                callback(err, body, res);
            }
        });

        return this;
    }
function ( publicKey , rules , callback ) { if ( ! Array . isArray ( rules ) ) { rules = [ rules ] ; } if ( ! publicKey ) { throw new Error ( 'Public key must be a valid string' ) ; } var url = this . getResourceUrl ( { path : '/keys/' + publicKey + '/access' , user : null } ) ; request ( { method : 'POST' , uri : this . getSignedResourceUrl ( 'POST' , url ) , json : rules , onComplete : function ( err , res , body ) { callback ( err , body , res ) ; } } ) ; return this ; }
Add one or more access control rules to the given public key

@param {String} publicKey The public key to add rules to
@param {Array} rules Array of access control rules to add
@param {Function} callback
@return {ImboClient}
Add one or more access control rules to the given public key