Write access array in group context should contain that groups acl

(this replaces #6413)

fixes a bug introduced by #6393.
adds a regression test.