--- 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
--- 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)
--- 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: