show grant availability

#484 also use shared function to get block code