[docs]deflist_all_destinations(action_code):""" Return the list of all destinations. If an action code is provided, only the destinations that the user has permission (based on the action_code) to access are returned. Parameters: ---------- action_code : str The action code to filter destinations. Possible values are 'C', 'R', 'U', 'V', 'E', 'D'. Returns: ------- destinations : List of Destination List of all destinations. """schema=DestinationSchema()query=sa.select(Destination)ifaction_code:query=query.where(Destination.filter_by_role(g.current_user,action_code))destinations=db.session.execute(query).scalars().all()returnschema.dump(destinations,many=True)