Frappe.has_permission not recognizing custom permissions from hooks

I am trying to check use access to a document, however I have noticed only permissions defined on the doctype are applied, hooks defined permissions are ignored. Permissions are applied corrected when I login to desk. Am I doing anything wrong ?

I’ve been running into the same problem, and it appears the issue may be related to this:

I got this working: in addition to what is in described in the issue, the permission_type parameter has been renamed to ptype