def can_access(sm, permission_name, view_name, user):
    """Protecting from has_access failing from missing perms/view"""
    if user.is_anonymous():
        return sm.is_item_public(permission_name, view_name)
    return sm._has_view_access(user, permission_name, view_name)
