'HRM Human Talent'

@staticmethod
def hrm():

    request = current.request
    if ('profile' in request.get_vars):
        return
    auth = current.auth
    has_role = auth.s3_has_role
    s3 = current.session.s3
    len_roles = len(s3.roles)
    if ((len_roles <= 2) or ((len_roles == 3) and has_role('RIT_MEMBER') and (not has_role('ADMIN')))):
        return
    ORG_ADMIN = s3.system_roles.ORG_ADMIN
    if ((request.function in ('certificate', 'course', 'course_certificate', 'facility', 'training', 'training_center', 'training_event')) or (request.controller == 'pr')):
        return M()(M('Training    Centers', c='hrm', f='training_center')(), M('Training    Course    Catalog', c='hrm', f='course')(M('Create', m='create'), M('Import', m='import', p='create', restrict=[ORG_ADMIN]), M('Certificates', f='certificate')), M('Training    Events', c='hrm', f='training_event')(M('Create', m='create'), M('Search    Training    Participants', f='training'), M('Import    Participant    List', f='training', m='import')), M('External    Trainees', c='pr', f='person')(M('Create', m='create')), M('Report', c='hrm', f='training', m='report')())
    else:
        return M()(M('Human    Talent', c='hrm', f='human_resource', m='summary')(M('Create', m='create'), M('Import', f='person', m='import', restrict=[ORG_ADMIN])), M('Report', c='hrm', f='human_resource', m='report')(), M('National    Societies', c='org', f='organisation', vars=red_cross_filter)(M('Create', m='create', vars=red_cross_filter), M('Import', m='import', p='create', restrict=[ORG_ADMIN])), M('Position    Catalog', c='hrm', f='job_title')(M('Create', m='create'), M('Import', m='import', p='create', restrict=[ORG_ADMIN])))
