checking access key permissions is a bit refactored