def __before__(self):
        """ Perform actions before action method is invoked.
            Deals with authentication.
        """

        # Add version to template context
        c.www_version = nipapwww.__version__

        # set authentication options
        o = AuthOptions(
            {
                'username': session.get('user'),
                'full_name': session.get('full_name'),
                'authoritative_source': 'nipap',
                'readonly': session.get('readonly')
            })


        # verify that user is logged in
        if self.requires_auth and 'user' not in session:
            # save path
            session['path_before_login'] = request.path_info
            session.save()
            redirect(url(controller='auth', action='login'))
dataset/ETHPy150Open SpriteLink/NIPAP/nipap-www/nipapwww/lib/base.py/BaseController.__before__/original