'Custom Modules Menu'

@classmethod
def menu_modules(cls):

    auth = current.auth
    has_role = auth.s3_has_role
    home_page_menu = homepage()
    if auth.s3_logged_in():
        alerting_menu = MM('Alerts', c='cap', f='alert')
        mapping_menu = MM('Map', c='gis', f='index')
        recipient_menu = MM('Recipients', c='pr', f='subscription', vars={'option': 'manage_recipient'})
        alert_hub_menu = MM('Alert    Hub', c='cap', f='alert', vars={'~.external': True})
        if has_role('ADMIN'):
            return [home_page_menu, alerting_menu, MM('Organizations', c='org', f='organisation'), MM('Persons', c='pr', f='person'), recipient_menu, mapping_menu]
        else:
            menus_ = [home_page_menu, alerting_menu]
            if has_role('MAP_ADMIN'):
                menus_.append(mapping_menu)
            else:
                return menus_
            return menus_
    return [home_page_menu, MM('View    Alerts', c='default', f='index', args=['alert_map'])]
