def METHOD_NAME(folder, path, method=''):
    """Perform a check by running restricted Python code."""
    traverse = "_.this.restrictedTraverse('%s')" % path
    if not method:
        body = '<dtml-call "%s()">' % traverse
    else:
        body = f'<dtml-call "{traverse}.{method}()">'
    addDTMLMethod(folder, 'ps', body=body)
    try:
        folder.ps(client=folder)
    except Unauthorized as e:
        raise AssertionError(e)