Ensure user is in correct group for whole write.
Pass context.
Merge pull request #2420 from ximenesuk/bulk-annotations-12210

Fix permissions in bulk annotation script