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, I propose writing all of this in one block, e.g.

<pre>
if @query.changed.include? 'is_public'
  actions << ((@query.changed_attributes['is_public'].last) ? :depublicize : :publicize)
  actions.delete(:update) unless (@query.changes - ['is_public']).empty?
end
</pre>