equal
deleted
inserted
replaced
38 except TypeError: |
38 except TypeError: |
39 warn('[3.6] %s: editable_attributes now take strict=False as ' |
39 warn('[3.6] %s: editable_attributes now take strict=False as ' |
40 'optional argument', DeprecationWarning) |
40 'optional argument', DeprecationWarning) |
41 editableattrs = form.editable_attributes() |
41 editableattrs = form.editable_attributes() |
42 for rschema, targetschemas, role in editableattrs: |
42 for rschema, targetschemas, role in editableattrs: |
43 if not rschema.is_final(): |
43 if not rschema.final: |
44 return 1 |
44 return 1 |
45 return 0 |
45 return 0 |
46 |
46 |
47 @objectify_selector |
47 @objectify_selector |
48 def match_searched_etype(cls, req, rset=None, **kwargs): |
48 def match_searched_etype(cls, req, rset=None, **kwargs): |
64 return 0 |
64 return 0 |
65 select = rqlst.children[0] |
65 select = rqlst.children[0] |
66 if len(select.defined_vars) == 1 and len(select.solutions) == 1: |
66 if len(select.defined_vars) == 1 and len(select.solutions) == 1: |
67 rset._searched_etype = select.solutions[0].itervalues().next() |
67 rset._searched_etype = select.solutions[0].itervalues().next() |
68 eschema = req.schema.eschema(rset._searched_etype) |
68 eschema = req.schema.eschema(rset._searched_etype) |
69 if not (eschema.is_final() or eschema.is_subobject(strict=True)) \ |
69 if not (eschema.final or eschema.is_subobject(strict=True)) \ |
70 and eschema.has_perm(req, 'add'): |
70 and eschema.has_perm(req, 'add'): |
71 return 1 |
71 return 1 |
72 return 0 |
72 return 0 |
73 |
73 |
74 # generic 'main' actions ####################################################### |
74 # generic 'main' actions ####################################################### |
268 req = self._cw |
268 req = self._cw |
269 eschema = entity.e_schema |
269 eschema = entity.e_schema |
270 for role, rschemas in (('subject', eschema.subject_relations()), |
270 for role, rschemas in (('subject', eschema.subject_relations()), |
271 ('object', eschema.object_relations())): |
271 ('object', eschema.object_relations())): |
272 for rschema in rschemas: |
272 for rschema in rschemas: |
273 if rschema.is_final(): |
273 if rschema.final: |
274 continue |
274 continue |
275 # check the relation can be added as well |
275 # check the relation can be added as well |
276 # XXX consider autoform_permissions_overrides? |
276 # XXX consider autoform_permissions_overrides? |
277 if role == 'subject'and not rschema.has_perm(req, 'add', |
277 if role == 'subject'and not rschema.has_perm(req, 'add', |
278 fromeid=entity.eid): |
278 fromeid=entity.eid): |