Check permission type for isGranted

see #9