lib/oauth2-helper.js
function isScopeAllowed(allowedScopes, tokenScopes) {
    allowedScopes = normalizeScope(allowedScopes);
    tokenScopes = normalizeScope(tokenScopes);
    if (allowedScopes.length === 0) {
        return true;
    }
    for (var i = 0, n = allowedScopes.length; i < n; i++) {
        if (tokenScopes.indexOf(allowedScopes[i]) !== -1) {
            return true;
        }
    }
    return false;
}
function isScopeAllowed(allowedScopes, tokenScopes) {
    allowedScopes = normalizeScope(allowedScopes);
    tokenScopes = normalizeScope(tokenScopes);
    if (allowedScopes.length === 0) {
        return true;
    }
    for (var i = 0, n = allowedScopes.length; i < n; i++) {
        if (tokenScopes.indexOf(allowedScopes[i]) !== -1) {
            return true;
        }
    }
    return false;
}
function isScopeAllowed ( allowedScopes , tokenScopes ) { allowedScopes = normalizeScope ( allowedScopes ) ; tokenScopes = normalizeScope ( tokenScopes ) ; if ( allowedScopes . length === 0 ) { return true ; } for ( var i = 0 , n = allowedScopes . length ; i < n ; i ++ ) { if ( tokenScopes . indexOf ( allowedScopes [ i ] ) !== - 1 ) { return true ; } } return false ; }
Check if one of the scopes is in the allowedScopes array
@param {String[]} allowedScopes An array of required scopes
@param {String[]} scopes An array of granted scopes
@returns {boolean}
Check if one of the scopes is in the allowedScopes array