```
def is_valid_assignment(domain, owner_id):
    owner = get_wrapped_owner(owner_id)
    return owner and owner.domain == domain and (not isinstance(owner, Group) or owner.case_sharing)