Get permissions for guest

I want to write python code that check the Guest permission for a given doctype (for example check if Guest has read permission for sales invoice) .
there is a function called frappe.has_permission() , but it only works for current user . I want to check for guest.

@bahaou You can just set user as guest for that python code.

frappe.set_user(‘Guest’)
if frappe.has_permission(‘Sales Invoice’, ‘read’):
return True