Exemplo n.º 1
0
 def get_userid(self):
     """ Get current user id. By default it uses
     ``pyramid.security.authenticated_userid``"""
     uri = tldata.get(USER_KEY, _not_set)
     if uri is _not_set:
         self.set_userid(authenticated_userid(get_current_request()))
         return tldata.get(USER_KEY)
     return uri
Exemplo n.º 2
0
 def get_userid(self):
     """ Get current user id. By default it uses
     ``pyramid.security.authenticated_userid``"""
     uri = tldata.get(USER_KEY, _not_set)
     if uri is _not_set:
         self.set_userid(authenticated_userid(get_current_request()))
         return tldata.get(USER_KEY)
     return uri
Exemplo n.º 3
0
 def get_userid(self):
     uid = tldata.get(USER_KEY, _not_set)
     if uid is _not_set:
         try:
             self.set_userid(authenticated_userid(get_current_request()))
         except:  # pragma: no cover
             self.set_userid(None)
         return tldata.get(USER_KEY)
     return uid
Exemplo n.º 4
0
 def get_effective_userid(self):
     """ Return effective user uri, of current user uri. """
     uri = tldata.get(EFFECTIVE_USER_KEY, _not_set)
     if uri is _not_set:
         return self.get_userid()
     return uri
Exemplo n.º 5
0
 def get_effective_userid(self):
     """ Return effective user uri, of current user uri. """
     uri = tldata.get(EFFECTIVE_USER_KEY, _not_set)
     if uri is _not_set:
         return self.get_userid()
     return uri
Exemplo n.º 6
0
 def get_effective_userid(self):
     uri = tldata.get(EFFECTIVE_USER_KEY, _not_set)
     if uri is _not_set:
         return self.get_userid()
     return uri
Exemplo n.º 7
0
 def get_userid(self):
     uri = tldata.get(USER_KEY, _not_set)
     if uri is _not_set:
         self.set_userid(authenticated_userid(get_current_request()))
         return tldata.get(USER_KEY)
     return uri