# HG changeset patch # User Sandrine Ribeau # Date 1260198640 28800 # Node ID 91d11fda4aa0ec517352621cd020d522fc4dbbe9 # Parent c89be0bdf9431e0a9eb2f2e6f516cb32396fbd5d more api renaming/fixing update diff -r c89be0bdf943 -r 91d11fda4aa0 web/uicfg.py --- a/web/uicfg.py Mon Dec 07 06:51:33 2009 -0800 +++ b/web/uicfg.py Mon Dec 07 07:10:40 2009 -0800 @@ -356,7 +356,7 @@ # permission which may imply rql queries _targetschemas = [] for tschema in targetschemas: - if not rtags.etype_get(eschema, rschema, role, tschema) in categories: + if not tag in self.etype_get(eschema, rschema, role, tschema): continue rdef = rschema.role_rdef(eschema, tschema, role) if not ((not strict and rdef.has_local_role(permission)) or @@ -374,7 +374,7 @@ yield (rschema, targetschemas, role) continue if rschema.final: - if not eschema.rdef(rschema).has_perm(entity._cw, permission, eid): + if not eschema.rdef(rschema).has_perm(entity._cw, permission, fromeid=eid): continue elif role == 'subject': # on relation with cardinality 1 or ?, we need delete perm as well diff -r c89be0bdf943 -r 91d11fda4aa0 web/views/editcontroller.py --- a/web/views/editcontroller.py Mon Dec 07 06:51:33 2009 -0800 +++ b/web/views/editcontroller.py Mon Dec 07 07:10:40 2009 -0800 @@ -70,6 +70,7 @@ req = self._cw self.errors = [] self.relations_rql = [] + form = req.form # so we're able to know the main entity from the repository side if '__maineid' in form: req.set_shared_data('__maineid', form['__maineid'], querydata=True) diff -r c89be0bdf943 -r 91d11fda4aa0 web/views/editforms.py --- a/web/views/editforms.py Mon Dec 07 06:51:33 2009 -0800 +++ b/web/views/editforms.py Mon Dec 07 07:10:40 2009 -0800 @@ -169,8 +169,8 @@ def should_edit_attribute(self, entity, rschema, role, form): rtype = str(rschema) - ttype = rschema.targets(entity.id, role)[0] - afs = uicfg.autoform_section.etype_get(entity.id, rtype, role, ttype) + ttype = rschema.targets(entity.__regid__, role)[0] + afs = uicfg.autoform_section.etype_get(entity.__regid__, rtype, role, ttype) if 'main_hidden' in afs or not entity.has_perm('update'): return False try: