You don't need to use CUG here, as they are for pages that need login.
You can use AccessControlUtils.getAccessControlList(adminSession, path)
to get the ACL instead. //Create your adminSession using a mapped
service user Map param = new HashMap();
param.put(ResourceResolverFactory.SUBSERVICE, "write-service"); //ensure
you have write-service user created via a config script or on
usermanager ResourceResolver resourceResolver =