def execute(self): obj = super(CreateDocumentFromTemplateCommand, self).execute() DocPropertyWriter(obj, recipient_data=self.recipient_data).initialize() # Set blocking of role inheritance based on the template object if self.block_role_inheritance is not None: obj.__ac_local_roles_block__ = self.block_role_inheritance # Copy the local roles assignations over from the template if self.role_assignments is not None: manager = RoleAssignmentManager(obj) # Passing an empty iterable in here creates an empty mapping manager.add_or_update_assignments(self.role_assignments) return obj
def execute(self): obj = super(CreateDocumentFromTemplateCommand, self).execute() DocPropertyWriter(obj, recipient_data=self.recipient_data).initialize() # Set blocking of role inheritance based on the template object if self.block_role_inheritance is not None: obj.__ac_local_roles_block__ = self.block_role_inheritance # Copy the local roles assignations over from the template if self.role_assignments is not None: manager = RoleAssignmentManager(obj) # Passing an empty iterable in here creates an empty mapping manager.add_or_update_assignments(self.role_assignments) return obj
def execute(self): obj = super(CreateDossierFromTemplateCommand, self).execute() schemas = iterSchemataForType(self.portal_type) for schema in schemas: schema_name = BEHAVIOR_INTERFACE_MAPPING.get( schema.getName(), schema.getName()) if schema_name not in self.additional_fields: continue behavior = schema(obj) for prop_name in self.additional_fields[schema_name]: setattr(behavior, prop_name, self.additional_fields[schema_name][prop_name]) # Set blocking of role inheritance based on the template object if self.block_role_inheritance is not None: obj.__ac_local_roles_block__ = self.block_role_inheritance # Copy the local roles assignations over from the template if self.role_assignments is not None: manager = RoleAssignmentManager(obj) # Passing an empty iterable in here creates an empty mapping manager.add_or_update_assignments(self.role_assignments) return obj
def execute(self): obj = super(CreateDossierFromTemplateCommand, self).execute() schemas = iterSchemataForType(self.portal_type) for schema in schemas: schema_name = BEHAVIOR_INTERFACE_MAPPING.get( schema.getName(), schema.getName()) if schema_name not in self.additional_fields: continue behavior = schema(obj) for prop_name in self.additional_fields[schema_name]: setattr(behavior, prop_name, self.additional_fields[schema_name][prop_name]) # Set blocking of role inheritance based on the template object if self.block_role_inheritance is not None: obj.__ac_local_roles_block__ = self.block_role_inheritance # Copy the local roles assignations over from the template if self.role_assignments is not None: manager = RoleAssignmentManager(obj) # Passing an empty iterable in here creates an empty mapping manager.add_or_update_assignments(self.role_assignments) return obj