schemas/bootstrap.py
branchstable
changeset 5210 1c635a91e403
parent 5179 f08943f22334
child 5421 8167de96c523
equal deleted inserted replaced
5209:52c9d25101a1 5210:1c635a91e403
   309     object = 'CWEType'
   309     object = 'CWEType'
   310 
   310 
   311 def post_build_callback(schema):
   311 def post_build_callback(schema):
   312     """set attributes permissions for schema/workflow entities"""
   312     """set attributes permissions for schema/workflow entities"""
   313     from cubicweb.schema import SCHEMA_TYPES, WORKFLOW_TYPES, META_RTYPES
   313     from cubicweb.schema import SCHEMA_TYPES, WORKFLOW_TYPES, META_RTYPES
       
   314     wftypes = WORKFLOW_TYPES - set(('TrInfo',))
   314     for eschema in schema.entities():
   315     for eschema in schema.entities():
   315         if eschema in SCHEMA_TYPES or eschema in WORKFLOW_TYPES:
   316         if eschema in SCHEMA_TYPES or eschema in wftypes:
   316             for rschema in eschema.subject_relations():
   317             for rschema in eschema.subject_relations():
   317                 if rschema.final and not rschema in META_RTYPES:
   318                 if rschema.final and not rschema in META_RTYPES:
   318                     rdef = eschema.rdef(rschema)
   319                     rdef = eschema.rdef(rschema)
   319                     rdef.permissions = PUB_SYSTEM_ATTR_PERMS
   320                     rdef.permissions = PUB_SYSTEM_ATTR_PERMS