# HG changeset patch # User cheb # Date 1295514394 -3600 # Node ID ffc982faa264d42fc9babc98310a6b34972b6250 # Parent 824d5b6eae7fd40ec70fadeb8451a4c871b65b27 [views] delete ``permission`` tab in ``SchemaView`` diff -r 824d5b6eae7f -r ffc982faa264 utils.py --- a/utils.py Wed Jan 19 19:15:04 2011 +0100 +++ b/utils.py Thu Jan 20 10:06:34 2011 +0100 @@ -112,7 +112,7 @@ # use networkX instead ? # http://networkx.lanl.gov/reference/algorithms.traversal.html#module-networkx.algorithms.traversal.astar -def transitive_closure_of(entity, relname, _seen=None): +def transitive_closure_of(entity, rtype, _seen=None): """return transitive closure *for the subgraph starting from the given entity* (eg 'parent' entities are not included in the results) """ @@ -120,10 +120,10 @@ _seen = set() _seen.add(entity.eid) yield entity - for child in getattr(entity, relname): + for child in getattr(entity, rtype): if child.eid in _seen: continue - for subchild in transitive_closure_of(child, relname, _seen): + for subchild in transitive_closure_of(child, rtype, _seen): yield subchild diff -r 824d5b6eae7f -r ffc982faa264 web/views/boxes.py --- a/web/views/boxes.py Wed Jan 19 19:15:04 2011 +0100 +++ b/web/views/boxes.py Thu Jan 20 10:06:34 2011 +0100 @@ -208,7 +208,6 @@ raise component.EmptyComponent() self.items = [] - class RsetBox(component.CtxComponent): """helper view class to display an rset in a sidebox""" __select__ = nonempty_rset() & match_kwargs('title', 'vid') diff -r 824d5b6eae7f -r ffc982faa264 web/views/schema.py --- a/web/views/schema.py Wed Jan 19 19:15:04 2011 +0100 +++ b/web/views/schema.py Thu Jan 20 10:06:34 2011 +0100 @@ -145,7 +145,7 @@ __regid__ = 'schema' title = _('instance schema') tabs = [_('schema-diagram'), _('schema-entity-types'), - _('schema-relation-types'), _('schema-security')] + _('schema-relation-types')] default_tab = 'schema-diagram' def call(self): @@ -183,110 +183,6 @@ self.wview('table', self._cw.execute( 'Any X ORDERBY N WHERE X is CWRType, X name N, X final FALSE')) - -class SchemaPermissionsTab(SecurityViewMixIn, StartupView): - __regid__ = 'schema-security' - __select__ = StartupView.__select__ & match_user_groups('managers') - - def call(self, display_relations=True): - skiptypes = skip_types(self._cw) - schema = self._cw.vreg.schema - # compute entities - entities = sorted(eschema for eschema in schema.entities() - if not (eschema.final or eschema in skiptypes)) - # compute relations - if display_relations: - relations = sorted(rschema for rschema in schema.relations() - if not (rschema.final - or rschema in skiptypes - or rschema in META_RTYPES)) - else: - relations = [] - # index - _ = self._cw._ - url = xml_escape(self._cw.build_url('schema')) - self.w(u'