index.js
function flattenAll() {
        var result = [];
        for (var role in permissions) {
            result = result.concat(flatten(role));
        }
        return uniq(result);
    }
function flattenAll() {
        var result = [];
        for (var role in permissions) {
            result = result.concat(flatten(role));
        }
        return uniq(result);
    }
function flattenAll ( ) { var result = [ ] ; for ( var role in permissions ) { result = result . concat ( flatten ( role ) ) ; } return uniq ( result ) ; }
FLatten the whole map
FLatten the whole map