selectors.py
changeset 7454 1090724f28ed
parent 7452 7e8182a63559
child 7529 2fdc310be7cd
equal deleted inserted replaced
7447:d5705c9bbe82 7454:1090724f28ed
  1340     * else check all entities in `col` (default to 0) are owned by the user
  1340     * else check all entities in `col` (default to 0) are owned by the user
  1341     """
  1341     """
  1342 
  1342 
  1343     @lltrace
  1343     @lltrace
  1344     def __call__(self, cls, req, rset=None, row=None, col=0, **kwargs):
  1344     def __call__(self, cls, req, rset=None, row=None, col=0, **kwargs):
  1345         if not req.cnx:
  1345         if not getattr(req, 'cnx', True): # default to True for repo session instances
  1346             return 0
  1346             return 0
  1347         user = req.user
  1347         user = req.user
  1348         if user is None:
  1348         if user is None:
  1349             return int('guests' in self.expected)
  1349             return int('guests' in self.expected)
  1350         score = user.matching_groups(self.expected)
  1350         score = user.matching_groups(self.expected)