Function to check if it's allowed to show a warning message