16650 impossible to unpublicize query by other user even when permission is assigned

[``* `#16650` Impossible to unpublicize query by other user even when permission is assigned``](https://www.openproject.org/work_packages/16560)
@hschink, this doesn't take the current and desired state of is_public into account. I propose using 

```actions << ((@query.changes['is_public'].last) ? :depublicize : :publicize) if @query.changed.include? 'is_public'```