selectors.py
changeset 4181 c79135c217df
parent 4102 5ba6df5fcb07
parent 4148 748454627176
child 4234 0adf45697422
--- a/selectors.py	Tue Dec 22 09:27:28 2009 +0100
+++ b/selectors.py	Tue Dec 22 10:27:49 2009 +0100
@@ -628,7 +628,12 @@
                     req.form['etype'] = etype
                 except KeyError:
                     return 0
-        return self.score_class(req.vreg['etypes'].etype_class(etype), req)
+        score = self.score_class(req.vreg['etypes'].etype_class(etype), req)
+        if score:
+            eschema = req.vreg.schema.eschema(etype)
+            if eschema.has_local_role('add') or eschema.has_perm(req, 'add'):
+                return score
+        return 0
 
 
 class relation_possible(EClassSelector):