Exemple #1
0
    def retract(self, comment=u''):
        if not ISubmittedDraftContent.providedBy(self):
            raise Unauthorized('retract')

        manager = IObjectPermissionsMapsManager(self)
        manager.set(())
        interface.noLongerProvides(self, ISubmittedDraftContent)
        event.notify(ObjectModifiedEvent(self))
        event.notify(events.DraftRetractedEvent(self.content, self, comment))
Exemple #2
0
    def submit(self, comment=u''):
        if not self.isSubmitable():
            raise DraftException("You can't submit content to this location.")

        manager = IObjectPermissionsMapsManager(self)
        manager.set(('draft.submitted',))

        interface.alsoProvides(self, ISubmittedDraftContent)
        event.notify(ObjectModifiedEvent(self))
        event.notify(events.DraftSubmittedEvent(self.content, self, comment))