def get_ticket_actions(self, req, ticket):
        # Get the list of actions that can be performed

        # Determine the current status of this ticket.  If this ticket is in
        # the process of being modified, we need to base our information on the
        # pre-modified state so that we don't try to do two (or more!) steps at
        # once and get really confused.
        status = ticket._old.get('status', ticket['status'])
        exists = status is not None

        ticket_perm = req.perm(ticket.resource)
        allowed_actions = []
        for action_name, action_info in self.actions.items():
            oldstates = action_info['oldstates']
            if exists and oldstates == ['*'] or status in oldstates:
                # This action is valid in this state.  Check permissions.
                required_perms = action_info['permissions']
                if self._is_action_allowed(ticket_perm, required_perms):
                    allowed_actions.append((action_info['default'],
                                            action_name))
        # Append special `_reset` action if status is invalid.
        if exists and status not in TicketSystem(self.env).get_all_status():
            reset = self.actions['_reset']
            required_perms = reset['permissions']
            if self._is_action_allowed(ticket_perm, required_perms):
                allowed_actions.append((reset['default'], '_reset'))
        return allowed_actions
Returns a list of (weight, action) tuples that are valid for this
dataset/ETHPy150Open edgewall/trac/trac/ticket/default_workflow.py/ConfigurableTicketWorkflow.get_ticket_actions