# Parameter run\_as for "role"

**URL:** https://discuss.elastic.co/t/parameter-run-as-for-role/52196
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [June 8, 2016, 10:26am UTC](https://discuss.elastic.co/t/parameter-run-as-for-role/52196 "2016-06-08T10:26:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_t/32/1305_2.png) [@Alex\_T](https://discuss.elastic.co/u/Alex_T)
#### Post date: [June 8, 2016, 10:26am UTC](https://discuss.elastic.co/t/parameter-run-as-for-role/52196/1 "2016-06-08T10:26:08Z")

</div>

Hi all.

Can I use run\_as for "role". For example

I several roles: [user\_role, customer\_role, client\_role] and one user: jonny

Can I submit request as user "jonny", to determine what role I want to get the result?

Thanks

---

<div class="post-metadata">

### Author: ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)
#### Post date: [June 10, 2016, 11:30am UTC](https://discuss.elastic.co/t/parameter-run-as-for-role/52196/2 "2016-06-10T11:30:55Z")

</div>

Hi Alex,

The run as feature is tied to a user and not roles. When you run as a different user, the request will execute as the run as user with that user's roles.

For example, lets say you have an `admin` user that submits a run as request for `jonny`. This request will execute with the privileges of all the roles that are assigned to `jonny`.

---

<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: [July 6, 2017, 1:44pm UTC](https://discuss.elastic.co/t/parameter-run-as-for-role/52196/3 "2017-07-06T13:44:09Z")

</div>


