add requirePermission method
add ERR_PERMISSION constant
update requirePermission method