code: def _recursive_reindex_object_security(self, obj):
          
          if hasattr(aq_base(obj), "objectValues"):
              for obj in obj.objectValues():
                  self._recursive_reindex_object_security(obj)
  
          logger.debug("Reindexing object security for {}".format(repr(obj)))
          obj.reindexObjectSecurity()
docs: Reindex object security after user linking