'If no user logged, set the public user of current website, or default
public user as request uid.
After this method `request.env` can be called, since the `request.uid` is
set. The `env` lazy property of `request` will be correct.'

@classmethod
def _auth_method_public(cls):

    if (not request.session.uid):
        env = api.Environment(request.cr, SUPERUSER_ID, request.context)
        website = env['website'].get_current_website()
        if website:
            request.uid = website.user_id.id
        else:
            request.uid = env.ref('base.public_user').id
    else:
        request.uid = request.session.uid
