app/soc/logic/site/id_user.py
changeset 141 e120c24b89e2
parent 138 e1167bdf71a4
child 164 afdf502c6cc4
equal deleted inserted replaced
140:c3d098d6fafa 141:e120c24b89e2
   132   """
   132   """
   133   if getUserFromId(id):
   133   if getUserFromId(id):
   134     return True
   134     return True
   135   else:
   135   else:
   136     return False
   136     return False
   137 
   137     
       
   138 def isIdUser(id=None):
       
   139   """Returns True if Google Account has it's soc.models.user.User entity in datastore.
       
   140 
       
   141   Args:
       
   142     id: a Google Account (users.User) object; if id is not supplied,
       
   143       the current logged-in user is checked
       
   144   """
       
   145   id = getIdIfMissing(id)
       
   146 
       
   147   if not id:
       
   148     # no Google Account was supplied or is logged in
       
   149     return False
       
   150 
       
   151   user = getUserFromId(id)
       
   152 
       
   153   if not user:
       
   154     # no User entity for this Google Account
       
   155     return False
       
   156   
       
   157   return True
   138 
   158 
   139 def isIdDeveloper(id=None):
   159 def isIdDeveloper(id=None):
   140   """Returns True if Google Account is a Developer with special privileges.
   160   """Returns True if Google Account is a Developer with special privileges.
   141   
   161   
   142   Since it only works on the current logged-in user, if id matches the
   162   Since it only works on the current logged-in user, if id matches the