'Get current location hierarchy levels relevant for the user'

def get_relevant_hierarchy_levels(self, as_dict=False):

    levels = self.relevant_hierarchy_levels
    if (not levels):
        levels = OrderedDict(self.get_location_hierarchy())
        if ((len(current.deployment_settings.get_gis_countries()) == 1) or current.response.s3.gis.config.region_location_id):
            levels.pop('L0', None)
        self.relevant_hierarchy_levels = levels
    if (not as_dict):
        return levels.keys()
    else:
        return levels
