def METHOD_NAME(db, attachment_access_test_env, event_prot, session_prot, session_contrib_prot,
                       standalone_contrib_prot, accessible):
    env = attachment_access_test_env
    env.event.protection_mode = ProtectionMode[event_prot]
    env.session.protection_mode = ProtectionMode[session_prot or 'inheriting']
    env.session_contrib.protection_mode = ProtectionMode[session_contrib_prot or 'inheriting']
    env.standalone_contrib.protection_mode = ProtectionMode[standalone_contrib_prot or 'inheriting']
    db.session.flush()
    env.assert_access_check(env.event_attachment, 'event' in accessible)
    env.assert_access_check(env.session_attachment, 'session' in accessible)
    env.assert_access_check(env.standalone_contrib_attachment, 'standalone_contrib' in accessible)
    env.assert_access_check(env.session_contrib_attachment, 'session_contrib' in accessible)