Improve the detection of ID types in has_permission().
Improve the detection of ID types in has_permission().

kaze/paasmaker,paasmaker/paasmaker,kaze/paasmaker,paasmaker/paasmaker,kaze/paasmaker,paasmaker/paasmaker,kaze/paasmaker,paasmaker/paasmaker,kaze/paasmaker,paasmaker/paasmaker