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: