code: def has_access(self, permission_name, view_name):
          
          if current_user.is_authenticated:
              return self._has_view_access(g.user, permission_name, view_name)
          elif current_user_jwt:
              return self._has_view_access(current_user_jwt, permission_name, view_name)
          else:
              return self.is_item_public(permission_name, view_name)
docs: Check if current user or public has access to view or menu