示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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