In what ways can the judiciary balance freedom of expression with concerns about public order when deciding on film releases?

The Supreme Court allowed the release of the film 'Udaipur Files.' This makes me wonder how courts weigh artistic freedom against potential risks to peace and order.