def _get_subject(self):
web_registry = WebYosai.get_current_webregistry()<EOL>subject_context = WebSubjectContext(yosai=self,<EOL>security_manager=self.security_manager,<EOL>web_registry=web_registry)<EOL>subject = self.security_manager.create_subject(subject_context=subject_context)<EOL>if not hasattr(subject, '<STR_LIT>'):<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>raise AttributeError(msg)<EOL><DEDENT>return subject<EOL>
Returns the currently accessible Subject available to the calling code
depending on runtime environment.

:param web_registry:  The WebRegistry instance that knows how to interact
                      with the web application's request and response APIs

:returns: the Subject currently accessible to the calling code