equal
deleted
inserted
replaced
273 sectdict.setdefault('main', 'hidden') |
273 sectdict.setdefault('main', 'hidden') |
274 sectdict.setdefault('muledit', 'hidden') |
274 sectdict.setdefault('muledit', 'hidden') |
275 sectdict.setdefault('inlined', 'hidden') |
275 sectdict.setdefault('inlined', 'hidden') |
276 # ensure we have a tag for each form type |
276 # ensure we have a tag for each form type |
277 if not 'main' in sectdict: |
277 if not 'main' in sectdict: |
278 if not rschema.is_final() and ( |
278 if not rschema.final and ( |
279 sectdict.get('inlined') == 'attributes' or |
279 sectdict.get('inlined') == 'attributes' or |
280 'inlined_attributes' in self.init_get(sschema, rschema, oschema, |
280 'inlined_attributes' in self.init_get(sschema, rschema, oschema, |
281 neg_role(role))): |
281 neg_role(role))): |
282 sectdict['main'] = 'hidden' |
282 sectdict['main'] = 'hidden' |
283 elif sschema.is_metadata(rschema): |
283 elif sschema.is_metadata(rschema): |
286 card, composed = _card_and_comp(sschema, rschema, oschema, role) |
286 card, composed = _card_and_comp(sschema, rschema, oschema, role) |
287 if card in '1+': |
287 if card in '1+': |
288 sectdict['main'] = 'attributes' |
288 sectdict['main'] = 'attributes' |
289 if not 'muledit' in sectdict: |
289 if not 'muledit' in sectdict: |
290 sectdict['muledit'] = 'attributes' |
290 sectdict['muledit'] = 'attributes' |
291 elif rschema.is_final(): |
291 elif rschema.final: |
292 sectdict['main'] = 'attributes' |
292 sectdict['main'] = 'attributes' |
293 else: |
293 else: |
294 sectdict['main'] = 'relations' |
294 sectdict['main'] = 'relations' |
295 if not 'muledit' in sectdict: |
295 if not 'muledit' in sectdict: |
296 sectdict['muledit'] = 'hidden' |
296 sectdict['muledit'] = 'hidden' |
368 # permission is not verifiable until the entity is actually |
368 # permission is not verifiable until the entity is actually |
369 # created... |
369 # created... |
370 if eid is None and '%s_on_new' % permission in permsoverrides.etype_get(eschema, rschema, role): |
370 if eid is None and '%s_on_new' % permission in permsoverrides.etype_get(eschema, rschema, role): |
371 yield (rschema, targetschemas, role) |
371 yield (rschema, targetschemas, role) |
372 continue |
372 continue |
373 if rschema.is_final(): |
373 if rschema.final: |
374 if not rschema.has_perm(entity._cw, permission, eid): |
374 if not rschema.has_perm(entity._cw, permission, eid): |
375 continue |
375 continue |
376 elif role == 'subject': |
376 elif role == 'subject': |
377 if not ((not strict and rschema.has_local_role(permission)) or |
377 if not ((not strict and rschema.has_local_role(permission)) or |
378 rschema.has_perm(entity._cw, permission, fromeid=eid)): |
378 rschema.has_perm(entity._cw, permission, fromeid=eid)): |