web/views/schema.py
changeset 3777 3ef8cdb5fb1c
parent 3720 5376aaadd16b
parent 3768 8c85a2f7f5ad
child 3890 d7a270f50f54
--- a/web/views/schema.py	Mon Oct 19 20:22:01 2009 +0200
+++ b/web/views/schema.py	Wed Oct 21 17:32:20 2009 +0200
@@ -18,7 +18,7 @@
 from cubicweb.schemaviewer import SchemaViewer
 from cubicweb.view import EntityView, StartupView
 from cubicweb.common import tags, uilib
-from cubicweb.web import action, facet
+from cubicweb.web import action, facet, uicfg
 from cubicweb.web.views import TmpFileViewMixin
 from cubicweb.web.views import primary, baseviews, tabs, management
 
@@ -36,6 +36,11 @@
         return SKIP_TYPES
     return ALWAYS_SKIP_TYPES
 
+_pvs = uicfg.primaryview_section
+for _action in ('read', 'add', 'update', 'delete'):
+    _pvs.tag_subject_of(('*', '%s_permission' % _action, '*'), 'hidden')
+    _pvs.tag_object_of(('*', '%s_permission' % _action, '*'), 'hidden')
+
 # global schema view ###########################################################
 
 class SchemaView(tabs.TabsMixin, StartupView):
@@ -279,6 +284,7 @@
 
     def cell_call(self, row, col):
         entity = self.cw_rset.get_entity(row, col)
+        _ = self._cw._
         self.w(u'<h2>%s</h2>' % _('Add permissions'))
         rset = self._cw.execute('Any P WHERE X add_permission P, '
                                 'X eid %(x)s',
@@ -335,7 +341,7 @@
         super(CWRTypeSchemaView, self).render_entity_attributes(entity)
         rschema = self._cw.vreg.schema.rschema(entity.name)
         viewer = SchemaViewer(self._cw)
-        layout = viewer.visit_relationschema(rschema)
+        layout = viewer.visit_relationschema(rschema, title=False)
         self.w(uilib.ureport_as_html(layout))
         if not rschema.final:
             msg = self._cw._('graphical schema for %s') % entity.name