Enhanced to pass permission settings to Application.run().