def validate_private_folder_pasting(self, objs): """Check that only private content is pasted to private containers. """ if IPrivateContainer.providedBy(self.context): return all( [self.is_content_in_private_folder(obj) for obj in objs]) return True
def is_content_in_private_folder(self, obj): parent = aq_parent(aq_inner(obj)) return IPrivateContainer.providedBy(parent)