PTA_ENV_KEY = "PUBLISHING_EXPLICIT_ACQUISITION"
SKIP_PTA = os.environ.get(PTA_ENV_KEY, "true") == "false"
@adapter(IPubAfterTraversal)
def after_traversal_hook(event):
if SKIP_PTA or IPublishableThroughAcquisition.providedBy(event.request):
return
context = event.request["PARENTS"][0]
if IShouldAllowAcquiredItemPublication(context, None) is False:
raise NotFound()
Can someone shed some light on the purpose of IPublishableThroughAcquisition and the check related to the environment variable PUBLISHING_EXPLICIT_ACQUISITION?
Setting the environment variable to false may solve the problem, but I am uncertain about the potential drawbacks.
The intention is to have a hook so we can check for implictly acquired objects in publication, alike collective.explicitacquisition, including plone.rest support.
By default, SKIP_PTA evaluates to False in Plone 6.0.7.
Is this the desired behaviour? With the current default (without having PUBLISHING_EXPLICIT_ACQUISITION set), this additional check is enabled by default. Is this correct?