'Return the userid of the currently authenticated user or
``None`` if there is no :term:`authentication policy` in effect or
there is no currently authenticated user.
.. versionadded:: 1.5'

@property
def authenticated_userid(self):

    policy = self._get_authentication_policy()
    if (policy is None):
        return None
    return policy.authenticated_userid(self)
