I have a commonly used SQLAlchemy filter (controls user permissions across the platform), which I\'ve tried to extract into a function:
def get_interaction_sharin