def process_tasks
      @tasks.each_value do |task|
        task.options[:ancestors] = []
        set_ancestor_tasks(task)
        set_alternative_tasks(task) if @permissions.key? task.name
      end
    end
def process_tasks
      @tasks.each_value do |task|
        task.options[:ancestors] = []
        set_ancestor_tasks(task)
        set_alternative_tasks(task) if @permissions.key? task.name
      end
    end
Flattens the tasks. It sets the ancestors and the alternative tasks