public Optional<PermissioningConfiguration> permissioningConfiguration(
      final JsonRpcHttpOptions jsonRpcHttpOptions,
      final RpcWebsocketOptions rpcWebsocketOptions,
      final EnodeDnsConfiguration enodeDnsConfiguration,
      final Path dataPath,
      final Logger logger,
      final CommandLine commandLine)
      throws Exception {
    if (!(localPermissionsEnabled())) {
      if (jsonRpcHttpOptions.getRpcHttpApis().contains(RpcApis.PERM.name())
          || rpcWebsocketOptions.getRpcWsApis().contains(RpcApis.PERM.name())) {
        logger.warn(
            "Permissions are disabled. Cannot enable PERM APIs when not using Permissions.");
      }
      return Optional.empty();
    }

    final Optional<LocalPermissioningConfiguration> localPermissioningConfigurationOptional;
    if (localPermissionsEnabled()) {
      final Optional<String> nodePermissioningConfigFile =
          Optional.ofNullable(nodePermissionsConfigFile);
      final Optional<String> accountPermissioningConfigFile =
          Optional.ofNullable(accountPermissionsConfigFile);

      final LocalPermissioningConfiguration localPermissioningConfiguration =
          PermissioningConfigurationBuilder.permissioningConfiguration(
              permissionsNodesEnabled,
              enodeDnsConfiguration,
              nodePermissioningConfigFile.orElse(getDefaultPermissioningFilePath(dataPath)),
              permissionsAccountsEnabled,
              accountPermissioningConfigFile.orElse(getDefaultPermissioningFilePath(dataPath)));

      localPermissioningConfigurationOptional = Optional.of(localPermissioningConfiguration);
    } else {
      if (nodePermissionsConfigFile != null && !permissionsNodesEnabled) {
        logger.warn(
            "Node permissioning config file set {} but no permissions enabled",
            nodePermissionsConfigFile);
      }

      if (accountPermissionsConfigFile != null && !permissionsAccountsEnabled) {
        logger.warn(
            "Account permissioning config file set {} but no permissions enabled",
            accountPermissionsConfigFile);
      }
      localPermissioningConfigurationOptional = Optional.empty();
    }

    final PermissioningConfiguration permissioningConfiguration =
        new PermissioningConfiguration(localPermissioningConfigurationOptional);

    return Optional.of(permissioningConfiguration);
  }
Creates a PermissioningConfiguration based on the provided options.

@param jsonRpcHttpOptions The JSON-RPC HTTP options
@param rpcWebsocketOptions The RPC websocket options
@param enodeDnsConfiguration The enode DNS configuration
@param dataPath The data path
@param logger The logger
@param commandLine The command line
@return An Optional PermissioningConfiguration instance
@throws Exception If an error occurs while creating the configuration
app/src/main/java/org/hyperledger/besu/cli/options/PermissionsOptions.java