predicates.py
changeset 9553 be9b12f42d76
parent 9547 43aace16a953
child 9892 928732ec00dd
child 9984 793377697c81
equal deleted inserted replaced
9552:1358f8ef1b5b 9553:be9b12f42d76
  1288         return 1
  1288         return 1
  1289     return 0
  1289     return 0
  1290 
  1290 
  1291 @objectify_predicate
  1291 @objectify_predicate
  1292 def authenticated_user(cls, req, **kwargs):
  1292 def authenticated_user(cls, req, **kwargs):
  1293     """Return 1 if the user is authenticated (e.g. not the anonymous user).
  1293     """Return 1 if the user is authenticated (i.e. not the anonymous user).
  1294 
  1294 
  1295     May only be used on the web side, not on the data repository side.
  1295     May only be used on the web side, not on the data repository side.
  1296     """
  1296     """
  1297     if req.session.anonymous_session:
  1297     if req.session.anonymous_session:
  1298         return 0
  1298         return 0
  1299     return 1
  1299     return 1
  1300 
  1300 
  1301 
  1301 
  1302 # XXX == ~ authenticated_user()
  1302 # XXX == ~ authenticated_user()
  1303 def anonymous_user():
  1303 def anonymous_user():
  1304     """Return 1 if the user is not authenticated (e.g. is the anonymous user).
  1304     """Return 1 if the user is not authenticated (i.e. is the anonymous user).
  1305 
  1305 
  1306     May only be used on the web side, not on the data repository side.
  1306     May only be used on the web side, not on the data repository side.
  1307     """
  1307     """
  1308     return ~ authenticated_user()
  1308     return ~ authenticated_user()
  1309 
  1309