def setSecurityPolicy(aSecurityPolicy):
    """Set the system default security policy, and return the previous
    value.

    This method should only be called by system startup code.
    It should never, for example, be called during a web request.
    """
    global _defaultPolicy
    last, _defaultPolicy = _defaultPolicy, aSecurityPolicy
    return last
