Changeset 543


Ignore:
Timestamp:
08/09/11 13:51:58 (9 years ago)
Author:
bas
Message:

comment permission check for workflow. Is already done and some minor reformating of code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r541 r543  
    860860        #
    861861        if self.parameters.email_triggers_workflow and (self.VERSION >= 0.11):
    862 
    863862            self.logger.debug('Workflow ticket update fields: ')
    864 
    865863
    866864            req = Mock(authname=self.author, perm=MockPerm(), args={})
     
    869867            try:
    870868                workflow = self.parameters['workflow_%s' %tkt['status'].lower()]
     869
    871870            except KeyError:
    872871                ##
     
    878877                    workflow = self.parameters.workflow
    879878
    880 
    881879            if workflow:
    882880
     
    885883                for controller in ticket_system.action_controllers:
    886884
    887                     if self.parameters.ticket_permission_system:
    888 
    889                         ## Could be disabled in the future !?
    890                         #
    891                         try:
    892                             if not self.check_permission(tkt, controller.actions[workflow]['permissions'][0]):
    893                                 self.logger.info('Reporter: %s has no permission to trigger workflow' %self.author)
    894                                 break
    895                         except AttributeError, detail:
    896                                 self.logger.info('controller %s has no actions implementations' %(controller))
     885                    ## Not Needed anymore, 9 Aug 2011 BvdV, we already checked the permissions
     886                    #
     887                    #if self.parameters.ticket_permission_system:
     888                    #
     889                    #
     890                    #   try:
     891                    #     if not self.check_permission(tkt, controller.actions[workflow]['permissions'][0]):
     892                    #            self.logger.info('Reporter: %s has no permission to trigger workflow' %self.author)
     893                    #            break
     894                    #    except AttributeError, detail:
     895                    #            self.logger.info('controller %s has no actions implementations' %(controller))
     896                    #
    897897
    898898                    fields = controller.get_ticket_changes(req, tkt, workflow)
     
    942942
    943943        if body_text.strip() or update_fields or self.properties:
     944
    944945            if self.parameters.dry_run:
    945946                print 'DRY_RUN: tkt.save_changes(self.author, body_text, ticket_change_number) ', self.author, cnum
     947
    946948            else:
    947949                if error_with_attachments:
    948950                    body_text = '%s\\%s' %(error_with_attachments, body_text)
     951
    949952                self.logger.debug('tkt.save_changes(%s, %d)' %(self.author, cnum))
    950953                tkt.save_changes(self.author, body_text, when, None, str(cnum))
    951954           
    952 
    953955        if not spam:
    954956            self.notify(tkt, False, when)
Note: See TracChangeset for help on using the changeset viewer.