function hierarchyRoles(roles){
    let hierarchy = []
    for(let i = 0; i<roles.length; i++){
        const subRoles = hierarchyRoles(memoryDB.RH[roles[i]])
        for(let j = 0; j < subRoles.length; j++){
            if(!hierarchy.includes(subRoles[j])){
                hierarchy.push(subRoles[j])
            }
        }
    }
    return hierarchy.concat(roles)
}
/**
 * gets an array containing all roles of a hierarchy of roles
 *
 * @param roles father roles to begin the hierarchy
 * @return {Array.<*>} all roles in the hierarchy (does not contain duplicates)
 */
gets an array containing all roles of a hierarchy of roles
@param roles father roles to begin the hierarchy
@return {Array.<*>} all roles in the hierarchy (does not contain duplicates)
gets an array containing all roles of a hierarchy of roles @param roles father roles to begin the hierarchy @return { Array . < * > } all roles in the hierarchy ( does not contain duplicates )
function hierarchyRoles(roles){
    let hierarchy = []
    for(let i = 0; i<roles.length; i++){
        const subRoles = hierarchyRoles(memoryDB.RH[roles[i]])
        for(let j = 0; j < subRoles.length; j++){
            if(!hierarchy.includes(subRoles[j])){
                hierarchy.push(subRoles[j])
            }
        }
    }
    return hierarchy.concat(roles)
}
function hierarchyRoles ( roles ) { let hierarchy = [ ] for ( let i = 0 ; i < roles . length ; i ++ ) { const subRoles = hierarchyRoles ( memoryDB . RH [ roles [ i ] ] ) for ( let j = 0 ; j < subRoles . length ; j ++ ) { if ( ! hierarchy . includes ( subRoles [ j ] ) ) { hierarchy . push ( subRoles [ j ] ) } } } return hierarchy . concat ( roles ) }
gets an array containing all roles of a hierarchy of roles
 @param roles father roles to begin the hierarchy
 @return {Array.<*>} all roles in the hierarchy (does not contain duplicates)
gets an array containing all roles of a hierarchy of roles @param roles father roles to begin the hierarchy @return { Array . < * > } all roles in the hierarchy ( does not contain duplicates )