lib/oauth2-helper.js
function isScopeAuthorized(requestedScopes, authorizedScopes) {
    requestedScopes = normalizeScope(requestedScopes);
    authorizedScopes = normalizeScope(authorizedScopes);
    if (requestedScopes.length === 0) {
        return true;
    }
    for (var i = 0, n = requestedScopes.length; i < n; i++) {
        if (authorizedScopes.indexOf(requestedScopes[i]) === -1) {
            return false;
        }
    }
    return true;
}
function isScopeAuthorized(requestedScopes, authorizedScopes) {
    requestedScopes = normalizeScope(requestedScopes);
    authorizedScopes = normalizeScope(authorizedScopes);
    if (requestedScopes.length === 0) {
        return true;
    }
    for (var i = 0, n = requestedScopes.length; i < n; i++) {
        if (authorizedScopes.indexOf(requestedScopes[i]) === -1) {
            return false;
        }
    }
    return true;
}
function isScopeAuthorized ( requestedScopes , authorizedScopes ) { requestedScopes = normalizeScope ( requestedScopes ) ; authorizedScopes = normalizeScope ( authorizedScopes ) ; if ( requestedScopes . length === 0 ) { return true ; } for ( var i = 0 , n = requestedScopes . length ; i < n ; i ++ ) { if ( authorizedScopes . indexOf ( requestedScopes [ i ] ) === - 1 ) { return false ; } } return true ; }
Check if the requested scopes are covered by authorized scopes
@param {String|String[]) requestedScopes
@param {String|String[]) authorizedScopes
@returns {boolean}
Check if the requested scopes are covered by authorized scopes