Beispiel #1
0
    def get_yearfolder(self):
        if not self.yearfolder:
            catalog = getToolByName(self.context, 'portal_catalog')
            inbox = catalog(portal_type='opengever.inbox.inbox')[0].getObject()
            self.yearfolder = _get_yearfolder(inbox)

        return self.yearfolder
Beispiel #2
0
    def get_yearfolder(self):
        if not self.yearfolder:
            catalog = getToolByName(self.context, 'portal_catalog')
            inbox = catalog(portal_type='opengever.inbox.inbox')[0].getObject()
            self.yearfolder = _get_yearfolder(inbox)

        return self.yearfolder
    def store_in_yearfolder(self):
        """Move the forwarding (adapted context) in the actual yearfolder."""

        inbox = aq_parent(aq_inner(self.context))
        yearfolder = _get_yearfolder(inbox)

        try:
            # change security context
            _sm = AccessControl.getSecurityManager()
            AccessControl.SecurityManagement.newSecurityManager(
                self.context.REQUEST,
                AccessControl.SecurityManagement.SpecialUsers.system)

            clipboard = inbox.manage_cutObjects((self.context.getId(), ))
            yearfolder.manage_pasteObjects(clipboard)

        except:
            AccessControl.SecurityManagement.setSecurityManager(_sm)
            raise
        else:
            AccessControl.SecurityManagement.setSecurityManager(_sm)
    def store_in_yearfolder(self):
        """Move the forwarding (adapted context) in the actual yearfolder."""

        inbox = aq_parent(aq_inner(self.context))
        yearfolder = _get_yearfolder(inbox)

        try:
            # change security context
            _sm = AccessControl.getSecurityManager()
            AccessControl.SecurityManagement.newSecurityManager(
                    self.context.REQUEST,
                    AccessControl.SecurityManagement.SpecialUsers.system)

            clipboard = inbox.manage_cutObjects((self.context.getId(),))
            yearfolder.manage_pasteObjects(clipboard)

        except:
            AccessControl.SecurityManagement.setSecurityManager(
                _sm)
            raise
        else:
            AccessControl.SecurityManagement.setSecurityManager(
                _sm)