def METHOD_NAME(self, space):
    root_context = space.viewer_path.path[0]
    if root_context.type != 'ID':
        return False
    if not isinstance(root_context.id, bpy.types.Object):
        return False
    obj = root_context.id
    if obj is None:
        return False
    if obj.type == 'MESH':
        return obj.mode == 'EDIT'
    if obj.type == 'CURVES':
        return obj.mode in {'SCULPT_CURVES', 'EDIT'}
    if obj.type == 'POINTCLOUD':
        return obj.mode == 'EDIT'
    return False