'Custom Modules Menu'

@classmethod
def menu_modules(cls):

    has_role = current.auth.s3_has_role
    if has_role('ADMIN'):
        return [homepage(), M('Tenures', c='stdm', f='tenure'), M('Gardens', c='stdm', f='garden'), M('Parcels', c='stdm', f='parcel'), M('Structures', c='stdm', f='structure'), M('People', c='stdm', f='person'), M('Groups', c='stdm', f='group')]
    elif has_role('INFORMAL_SETTLEMENT'):
        locations = M('Structures', c='stdm', f='structure')
    elif has_role('RURAL_AGRICULTURE'):
        locations = M('Gardens', c='stdm', f='garden')
    elif has_role('LOCAL_GOVERNMENT'):
        locations = M('Parcels', c='stdm', f='parcel')
    else:
        locations = None
    return [homepage(), M('Tenures', c='stdm', f='tenure'), locations, M('People', c='stdm', f='person'), M('Groups', c='stdm', f='group')]
