# \[kibana space\] configure xpack Dashboards only roles for multiples space through API or config file

**URL:** <https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005>\
**Category:** Kibana\
**Created:** [September 25, 2019, 10:07am UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005 "2019-09-25T10:07:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![piellick](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@piellick](https://discuss.elastic.co/u/piellick)\
**Post date:** [September 25, 2019, 10:07am UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/1 "2019-09-25T10:07:11Z")

</div>

Hi eveyrone,

we have 78 spaces and we need to assign a tunned role to the " Dashboards only roles" on kibana "advanced" config on each space.

Could it be done through the config file or API ? I'm seeing nothing on doc.

Thanks 🙂

# Update:

For who whant to manage Space's "Advanced settings" :

Get the "config" object with the ID of your KIBANA version :

`GET http://KIBANA_URL/s/MY_SPACE/api/saved_objects/_find?type=config`

```auto
{
"page": 1,
"per_page": 20,
"total": 5,
"saved_objects": [
    {
        "type": "config",
        "id": "6.8.2",
        "attributes": {
            "buildNum": 20415,
            "defaultIndex": "7f91a8c0-df79-11e9-9d78-9fd1480e4f36"
        },
        "updated_at": "2019-09-25T09:47:34.593Z",
        "version": "WzQ0LDFd"
    }
}

```

Perform a UPDATE (PUT) with the modified attribute :

```
PUT http://KIBANA_URL/s/MY_SPACE/api/saved_objects/config/6.8.2
{
    "attributes": {
        "xpackDashboardMode:roles": [
            "YOUR_ROLE"
        ]
    }
}
```

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [September 25, 2019, 12:16pm UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/2 "2019-09-25T12:16:11Z")

</div>

Hi @piellick,

the advanced settings are also a saved object and be manipulated using the [saved objects API](https://www.elastic.co/guide/en/kibana/master/saved-objects-api.html). The "type" of this saved object is `config`.

To retrieve objects from different spaces the space name has to be prepended to the path, e.g. `GET /s/demo/api/saved_objects/_find`

---

<div class="post-metadata">

**Author:** ![piellick](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@piellick](https://discuss.elastic.co/u/piellick)\
**Post date:** [September 25, 2019, 12:29pm UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/3 "2019-09-25T12:29:46Z")

</div>

Hi @flash1293 thanks for your Help.

i tried with this one :  
`/api/saved_objects/_find?type=config`

but i could retrive the config from "default" space, no select space ?

```
{"page":1,"per_page":20,"total":1,"saved_objects":[{"type":"config","id":"6.8.2","attributes":{"buildNum":20415,"xpackDashboardMode:roles":["pouet"],"defaultIndex":"414dd440-df78-11e9-9d78-9fd1480e4f36"},"updated_at":"2019-09-25T09:46:54.337Z","version":"WzQyLDFd"}]}

```

I'm on Elastic `6.8`

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [September 25, 2019, 12:31pm UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/4 "2019-09-25T12:31:07Z")

</div>

To get the config from another space, prepend the name of the space to the api call:  
`/s/<NAME OF THE SPACE>/api/saved_objects/_find?type=config`

---

<div class="post-metadata">

**Author:** ![piellick](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@piellick](https://discuss.elastic.co/u/piellick)\
**Post date:** [September 25, 2019, 1:31pm UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/5 "2019-09-25T13:31:06Z")

</div>

It look better ! Thanks @flash1293. Just few question i'm blocked with the create object.

I did some test :

`GET http://KIBANA_URL/s/MY_SPACE/api/saved_objects/_find?type=config`

```
{
"page": 1,
"per_page": 20,
"total": 5,
"saved_objects": [
    {
        "type": "config",
        "id": "6.8.2",
        "attributes": {
            "buildNum": 20415,
            "defaultIndex": "7f91a8c0-df79-11e9-9d78-9fd1480e4f36"
        },
        "updated_at": "2019-09-25T09:47:34.593Z",
        "version": "WzQ0LDFd"
    },
    {
        "type": "config",
        "id": "a205e540-df94-11e9-9d78-9fd1480e4f36",
        "attributes": {
            "xpackDashboardMode:roles": [
                "MYROLE_03"
            ]
        },
        "updated_at": "2019-09-25T13:01:47.796Z",
        "version": "WzUwLDFd"
    },
    {
        "type": "config",
        "id": "f53e5e90-df94-11e9-9d78-9fd1480e4f36",
        "attributes": {
            "xpackDashboardMode:roles": [
                "MYROLE_03"
            ]
        },
        "updated_at": "2019-09-25T13:04:07.417Z",
        "version": "WzUxLDFd"
    },
    {
        "type": "config",
        "id": "4246d410-df95-11e9-9d78-9fd1480e4f36",
        "attributes": {
            "xpackDashboardMode:roles": [
              "MYROLE_03"
            ]
        },
        "updated_at": "2019-09-25T13:06:16.657Z",
        "version": "WzU0LDFd"
    },
    {
        "type": "config",
        "id": "fep03",
        "attributes": {
            "xpackDashboardMode:roles": [
               "MYROLE_03"
            ]
        },
        "updated_at": "2019-09-25T13:24:03.399Z",
        "version": "WzU4LDFd"
    }
]

```

}

But on my KIBANA dashboard i still have the "kibana\_dashboard\_only\_user" role. How we link the config object to be used ?

Thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [September 25, 2019, 1:38pm UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/6 "2019-09-25T13:38:19Z")

</div>

Hi @piellick

two things:

- Did you try to modify the existing config object rather than creating a new one?
- You also have to assign the changed role to the user accounts in question for this to take effect

---

<div class="post-metadata">

**Author:** ![piellick](https://avatars.discourse-cdn.com/v4/letter/p/35a633/32.png) [@piellick](https://discuss.elastic.co/u/piellick)\
**Post date:** [September 25, 2019, 1:42pm UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/7 "2019-09-25T13:42:47Z")

</div>

You right !

I just had to do an update on the existing object, referer with the version of kibana `(id: 6.8.2)`

Thanis a lot @flash1293

---

<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:** [October 23, 2019, 1:42pm UTC](https://discuss.elastic.co/t/kibana-space-configure-xpack-dashboards-only-roles-for-multiples-space-through-api-or-config-file/201005/8 "2019-10-23T13:42:49Z")

</div>

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