# Connect a role to a space

**URL:** https://discuss.elastic.co/t/connect-a-role-to-a-space/218029
**Category:** Kibana
**Created:** [February 5, 2020, 4:53pm UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029 "2020-02-05T16:53:42Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![liorg2](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@liorg2](https://discuss.elastic.co/u/liorg2)
#### Post date: [February 5, 2020, 4:53pm UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/1 "2020-02-05T16:53:43Z")

</div>

hello  
I have a case where we have 1 dashboard for all clients (created in the default space) with index pattern client\_\*_. (includes: client\_1_ , client\_2\_ and so on..) example names...

I created a space for each client ,so it's account manager will be able to see (only) it's data in there: space\_1, space\_2 etc...

the problem is that the account manager, manages more clients, so i can't limit the indices permission only to a single client.

the required goal is that when choosing the space "space\_1", and going to the dashboard, it will use only "client\_1\_ " index and not client\_2 for example, and when choosing "space\_2", and going to the dashboard, he will see only the data of "client\_2\_ index".

is there a way to achieve it with roles/ space configuration?

---

<div class="post-metadata">

### Author: ![ArisP](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arisp/32/58381_2.png) [@ArisP](https://discuss.elastic.co/u/ArisP)
#### Post date: [February 6, 2020, 12:09am UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/2 "2020-02-06T00:09:08Z")

</div>

Hi, you can use multiple index patterns, one per client. Each client-specific space has the corresponding client-specific index pattern and a copy of the dashboard. You can easily copy objects across spaces now in Kibana but in this case you will need to make sure that each copy of your dashboard points to the right client-specific index pattern.

---

<div class="post-metadata">

### Author: ![liorg2](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@liorg2](https://discuss.elastic.co/u/liorg2)
#### Post date: [February 6, 2020, 5:49am UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/3 "2020-02-06T05:49:33Z")

</div>

Thanks a lot. @ArisP  
The index pattern is defined in the visualization level. But it seems to be impossible to change index pattern for most of them after creation. Can I change it in the dashboard level or during import somehow?

---

<div class="post-metadata">

### Author: ![ArisP](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arisp/32/58381_2.png) [@ArisP](https://discuss.elastic.co/u/ArisP)
#### Post date: [February 6, 2020, 1:16pm UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/4 "2020-02-06T13:16:44Z")

</div>

You are very welcome. Could you try the following, _after you back up your saved objects as required_? Go to Management / Saved Objects. Find the visualisation of which you want to change the underlying index pattern and click Actions / Inspect. In the view that opens up, find the "references" text area and you should see `"type":"index-pattern"`. You can replace the index pattern that the particular vis references by replacing the value of the `"id"` field in this area, with the "target" index pattern `id` you actually want it to reference. You can find each "target" index pattern's `id` in the address bar when you select it from within the Saved Objects management view. The `id` should follow the `#/management/kibana/index_patterns/` url chunk. Things can break easily on the level below the UI, so please take extra care not to lose any work.

---

<div class="post-metadata">

### Author: ![liorg2](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@liorg2](https://discuss.elastic.co/u/liorg2)
#### Post date: [February 6, 2020, 8:23pm UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/5 "2020-02-06T20:23:51Z")

</div>

Thanks!  
Can I do it via api?

---

<div class="post-metadata">

### Author: ![ArisP](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arisp/32/58381_2.png) [@ArisP](https://discuss.elastic.co/u/ArisP)
#### Post date: [February 7, 2020, 12:49pm UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/6 "2020-02-07T12:49:07Z")

</div>

This API should do the job:

[https://www.elastic.co/guide/en/kibana/master/saved-objects-api-update.html](https://www.elastic.co/guide/en/kibana/master/saved-objects-api-update.html)

Again, please use with extra care not to lose any work.

---

<div class="post-metadata">

### Author: ![liorg2](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@liorg2](https://discuss.elastic.co/u/liorg2)
#### Post date: [February 18, 2020, 12:44pm UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/7 "2020-02-18T12:44:26Z")

</div>

Hi  
It seems to be on master only

---

<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: [March 17, 2020, 12:44pm UTC](https://discuss.elastic.co/t/connect-a-role-to-a-space/218029/8 "2020-03-17T12:44:28Z")

</div>

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