code: def fix_client_permissions(portal):
      
      wfs = get_workflows()
  
      start = time.time()
      clients = portal.clients.objectValues()
      total = len(clients)
      for num, client in enumerate(clients):
          logger.info("Fixing permission for client {}/{} ({})"
                      .format(num, total, client.getName()))
          update_role_mappings(client, wfs=wfs)
      end = time.time()
      logger.info("Fixing client permissions took %.2fs" % float(end-start))
      transaction.commit()
docs: Fix client permissions