Check if the permission is granted at first.