Start Confluence Server/DC instance configured with anonymous access permission

Hi,
We’re starting Confluence instances using docker images and for testing purposes I’m looking for a way to start these configured with anonymous access enabled, or some way of programatically setting this value on a running instance. Either via Java APIs or REST. Any suggestions on how I can achieve this?

Not everyone at once people! :smiley:
I manages to find that the edit global action represents the permissions as SpacePermissions with null targets.

private static final SpacePermission ANONYMOUS_CAN_USE_PERM = SpacePermission.createAnonymousSpacePermission(
            "USECONFLUENCE",
            (Space) null);

So I manages to update it by saving the space permission using

spacePermissionManager.savePermission(ANONYMOUS_CAN_USE_PERM);

This method is deprecated and refer to an alternative, but that one is in an internal package and I had troubles using that. Seems that I’m not alone in this regard: How to use SpacePermissionContext