archiveHow permission can be checked at runtime without throwing SecurityException?