web/views/schema.py
changeset 3890 d7a270f50f54
parent 3777 3ef8cdb5fb1c
parent 3877 7ca53fc72a0a
child 4023 eae23c40627a
--- a/web/views/schema.py	Sun Nov 08 21:53:18 2009 +0100
+++ b/web/views/schema.py	Fri Nov 20 19:35:54 2009 +0100
@@ -358,13 +358,11 @@
 
     def should_display_schema(self, rschema):
         return (super(RestrictedSchemaVisitorMixIn, self).should_display_schema(rschema)
-                and (rschema.has_local_role('read')
-                     or rschema.has_perm(self._cw, 'read')))
+                and rschema.may_have_permission('read', self._cw))
 
-    def should_display_attr(self, rschema):
+    def should_display_attr(self, eschema, rschema):
         return (super(RestrictedSchemaVisitorMixIn, self).should_display_attr(rschema)
-                and (rschema.has_local_role('read')
-                     or rschema.has_perm(self._cw, 'read')))
+                and eschema.rdef(rschema).may_have_permission('read', self._cw))
 
 
 class FullSchemaVisitor(RestrictedSchemaVisitorMixIn, s2d.FullSchemaVisitor):