selectors.py
branchstable
changeset 4148 748454627176
parent 3757 122a01751d59
child 4181 c79135c217df
child 4212 ab6573088b4a
equal deleted inserted replaced
4134:40624a708dd4 4148:748454627176
   619                 try:
   619                 try:
   620                     etype = cls.vreg.case_insensitive_etypes[etype.lower()]
   620                     etype = cls.vreg.case_insensitive_etypes[etype.lower()]
   621                     req.form['etype'] = etype
   621                     req.form['etype'] = etype
   622                 except KeyError:
   622                 except KeyError:
   623                     return 0
   623                     return 0
   624         return self.score_class(cls.vreg['etypes'].etype_class(etype), req)
   624         score = self.score_class(cls.vreg['etypes'].etype_class(etype), req)
       
   625         if score:
       
   626             eschema = req.vreg.schema.eschema(etype)
       
   627             if eschema.has_local_role('add') or eschema.has_perm(req, 'add'):
       
   628                 return score
       
   629         return 0
   625 
   630 
   626 
   631 
   627 class entity_implements(ImplementsMixIn, EntitySelector):
   632 class entity_implements(ImplementsMixIn, EntitySelector):
   628     """accept if entity instances found in the result set implements at least one
   633     """accept if entity instances found in the result set implements at least one
   629     of the interfaces given as argument. Returned score is the number of
   634     of the interfaces given as argument. Returned score is the number of