fix checking for dir permissions when user is not logged in