server/session.py
changeset 9979 9ccdb3751fbe
parent 9934 e32964e28a45
child 10005 7769d0f61810
child 10059 dab538127d72
equal deleted inserted replaced
9978:8f4b15e5b300 9979:9ccdb3751fbe
  1709 
  1709 
  1710     # deprecated ###############################################################
  1710     # deprecated ###############################################################
  1711 
  1711 
  1712     @property
  1712     @property
  1713     def anonymous_session(self):
  1713     def anonymous_session(self):
  1714         # XXX for now, anonymous-user is a web side option.
  1714         # XXX for now, anonymous_user only exists in webconfig (and testconfig).
  1715         # It will only be present inside all-in-one instance.
  1715         # It will only be present inside all-in-one instance.
  1716         # there is plan to move it down to global config.
  1716         # there is plan to move it down to global config.
  1717         return self.user.login == self.repo.config.get('anonymous-user')
  1717         if not hasattr(self.repo.config, 'anonymous_user'):
       
  1718             # not a web or test config, no anonymous user
       
  1719             return False
       
  1720         return self.user.login == self.repo.config.anonymous_user()[0]
  1718 
  1721 
  1719     @deprecated('[3.13] use getattr(session.rtype_eids_rdef(rtype, eidfrom, eidto), prop)')
  1722     @deprecated('[3.13] use getattr(session.rtype_eids_rdef(rtype, eidfrom, eidto), prop)')
  1720     def schema_rproperty(self, rtype, eidfrom, eidto, rprop):
  1723     def schema_rproperty(self, rtype, eidfrom, eidto, rprop):
  1721         return getattr(self.rtype_eids_rdef(rtype, eidfrom, eidto), rprop)
  1724         return getattr(self.rtype_eids_rdef(rtype, eidfrom, eidto), rprop)
  1722 
  1725