Grouping Data Streams Based on Privilege Levels in UI

I have three data streams:

  • data_stream_one
  • data_stream_two
  • data_stream_three

And a single data collection input: CEL.

Privilege Levels:

  • Level C → Can access data_stream_one
  • Level B → Can access data_stream_one and data_stream_two
  • Level A → Can access all three data streams

Goal:

A user enters their API token, and the UI should present three toggle options (A, B, C) based on their privilege level. Each toggle should group the corresponding data streams accordingly.

What I Tried:

  • Created multiple policy templates, each specifying different data streams.
    • Issue: This resulted in four separate integrations in the UI, which is not what I want.
  • Used policy_templates_behavior: combined_policy
    • Issue: It didn't work as expected.

Question:

How can I achieve UI-level grouping of data streams based on privilege levels without creating multiple integrations?

(Code and UI references below)

Code

format_version: 3.3.1
name: sample
title: "collect sample logs"
version: 0.1.0
description: "This is a new package."
type: integration
categories:
  - custom
conditions:
  kibana:
    version: "^8.16.0"
  elastic:
    subscription: "basic"
screenshots:
  - src: /img/sample-screenshot.png
    title: Sample screenshot
    size: 600x600
    type: image/png
icons:
  - src: /img/sample-logo.svg
    title: Sample logo
    size: 32x32
    type: image/svg+xml
vars:
  - name: url
    type: url
    title: URL
    description: The base URL of the API.
    multi: false
    required: true
    show_user: false
  - name: access_token
    type: password
    title: Access Token
    description: Access Token used to authenticate the requests.
    multi: false
    required: true
    show_user: true
    secret: true
policy_templates_behavior: combined_policy
policy_templates:
  - name: sample_level_a
    title: Level A
    description: Collect sample level A privilege data.
    data_streams:
      - data_stream_one
      - data_stream_two
      - data_stream_three
    inputs:
      - type: cel
        title: Collect sample level A privilege data via API
        description: Collecting sample level A privilege data via API.
  - name: sample_level_b
    title: Level B
    description: Collect sample level B privilege data.
    data_streams:
      - data_stream_one
      - data_stream_two
    inputs:
      - type: cel
        title: Collect sample level B privilege data via API
        description: Collecting sample level B privilege data via API.
  - name: sample_level_c
    title: Level C
    description: Collect sample level C privilege data.
    data_streams:
      - data_stream_one
    inputs:
      - type: cel
        title: Collect sample level C privilege data via API.
        description: Collecting sample level C privilege data via API.

UI