def login_required(http_method_handler):
@wraps(http_method_handler)<EOL>def secure_http_method_handler(self, *args, **kwargs):<EOL><INDENT>if not self.__provider_config__.authentication:<EOL><INDENT>_message = "<STR_LIT>"<EOL>authentication_error = prestans.exception.AuthenticationError(_message)<EOL>authentication_error.request = self.request<EOL>raise authentication_error<EOL><DEDENT>if not self.__provider_config__.authentication.is_authenticated_user():<EOL><INDENT>authentication_error = prestans.exception.AuthenticationError()<EOL>authentication_error.request = self.request<EOL>raise authentication_error<EOL><DEDENT>http_method_handler(self, *args, **kwargs)<EOL><DEDENT>return secure_http_method_handler<EOL>
provides a decorator for RESTRequestHandler methods to check for authenticated users

RESTRequestHandler subclass must have a auth_context instance, refer to prestans.auth
for the parent class definition.

If decorator is used and no auth_context is provided the client will be denied access.

Handler will return a 401 Unauthorized if the user is not logged in, the service does
not redirect to login handler page, this is the client's responsibility.

auth_context_handler instance provides a message called get_current_user, use this
to obtain a reference to an authenticated user profile.

If all goes well, the original handler definition is executed.