You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue where some users were deleting the working copy instead of canceling the checkout. Unfortunately I can't just rely on them using the cancel option and need to find a tech solution. Deleting without canceling causes at least two problems.
The baseline content remains locked, in a way that is not even easily unlocked TTP
When the baseline is checked out again, the new working copy bizarrely declares itself to be both a working copy and its own baseline
I do not think blocking the delete action is the way to go because that is a high level action and other interfaces may provide other ways of deletion (such as the folder contents). Removing the "Delete objects" permission also won't work because deletion is still a part of the cancel checkout process. Instead, I looked to create a delete event listener that would emulate the cleanup part of policy.cancelCheckout as best as I understand it.
def delete_no_checkout(ob, event):
""" In case it is deleted without cancel """
policy = ICheckinCheckoutPolicy(ob, None)
if policy is not None:
# simulate policy.cancelCheckout except for the delete part of course
baseline = policy._getBaseline()
notify(CancelCheckoutEvent(ob, baseline))
As far as I can tell, this does what i would expect and makes delete and 'cancel' effectively the same. It does not appear to cause adverse affects when properly doing a cancel. The subscribers will be notified twice, but that seems to be fine. I believe the relevant subscribers are in marker.py and locking.py.
The text was updated successfully, but these errors were encountered:
Plone 5.0
plone.app.iterate 3.2.0
I ran into an issue where some users were deleting the working copy instead of canceling the checkout. Unfortunately I can't just rely on them using the cancel option and need to find a tech solution. Deleting without canceling causes at least two problems.
I do not think blocking the delete action is the way to go because that is a high level action and other interfaces may provide other ways of deletion (such as the folder contents). Removing the "Delete objects" permission also won't work because deletion is still a part of the cancel checkout process. Instead, I looked to create a delete event listener that would emulate the cleanup part of policy.cancelCheckout as best as I understand it.
As far as I can tell, this does what i would expect and makes delete and 'cancel' effectively the same. It does not appear to cause adverse affects when properly doing a cancel. The subscribers will be notified twice, but that seems to be fine. I believe the relevant subscribers are in marker.py and locking.py.
The text was updated successfully, but these errors were encountered: