src/schema/utils/index.js
function isRemoteMethodAllowed(method, allowedVerbs) {

    let httpArray = method.http;

    if (!_.isArray(method.http)) {
        httpArray = [method.http];
    }

    const results = httpArray.map((item) => {

        const verb = item.verb;

        if (allowedVerbs && !_.includes(allowedVerbs, verb)) {
            return false;
        }

        return true;
    });

    const result = _.includes(results, true);

    return result;
}
function isRemoteMethodAllowed(method, allowedVerbs) {

    let httpArray = method.http;

    if (!_.isArray(method.http)) {
        httpArray = [method.http];
    }

    const results = httpArray.map((item) => {

        const verb = item.verb;

        if (allowedVerbs && !_.includes(allowedVerbs, verb)) {
            return false;
        }

        return true;
    });

    const result = _.includes(results, true);

    return result;
}
function isRemoteMethodAllowed ( method , allowedVerbs ) { let httpArray = method . http ; if ( ! _ . isArray ( method . http ) ) { httpArray = [ method . http ] ; } const results = httpArray . map ( ( item ) => { const verb = item . verb ; if ( allowedVerbs && ! _ . includes ( allowedVerbs , verb ) ) { return false ; } return true ; } ) ; const result = _ . includes ( results , true ) ; return result ; }
Checks if a given remote method allowed based on the allowed verbs
@param {*} method
@param {*} allowedVerbs
Checks if a given remote method allowed based on the allowed verbs