# Grouping Data Streams Based on Privilege Levels in UI

**URL:** <https://discuss.elastic.co/t/grouping-data-streams-based-on-privilege-levels-in-ui/373938>\
**Category:** Elastic Security\
**Tags:** datastreams\
**Created:** [January 31, 2025, 1:09pm UTC](https://discuss.elastic.co/t/grouping-data-streams-based-on-privilege-levels-in-ui/373938 "2025-01-31T13:09:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshraj\_Chavda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshraj_chavda/32/141048_2.png) [@Akshraj\_Chavda](https://discuss.elastic.co/u/Akshraj_Chavda)\
**Post date:** [January 31, 2025, 1:09pm UTC](https://discuss.elastic.co/t/grouping-data-streams-based-on-privilege-levels-in-ui/373938/1 "2025-01-31T13:09:57Z")

</div>

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**

```yml
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**

 ![UI Sample](https://us1.discourse-cdn.com/elastic/original/3X/7/a/7a41f8aa81944fd5b80335dfe23271b760759d93.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 28, 2025, 1:10pm UTC](https://discuss.elastic.co/t/grouping-data-streams-based-on-privilege-levels-in-ui/373938/2 "2025-02-28T13:10:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
