# How does #all really work?

**URL:** <https://openziti.discourse.group/t/how-does-all-really-work/112>\
**Category:** Uncategorized\
**Created:** [August 10, 2020, 4:58pm UTC](https://openziti.discourse.group/t/how-does-all-really-work/112 "2020-08-10T16:58:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![qrkourier](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/qrkourier/32/52_2.png) [@qrkourier](https://openziti.discourse.group/u/qrkourier)\
**Post date:** [August 10, 2020, 4:58pm UTC](https://openziti.discourse.group/t/how-does-all-really-work/112/1 "2020-08-10T16:58:59Z")

</div>

> `#all` is a magic word that may be used on a policy to match all of the resources of that particular type

For example, on a service policy, I can include `#all` as a service role to match all services, or `#all` as an identity role to match all identities. `#all` doesn't make sense as a role attribute on a resource e.g. identity, service, or edge router; because it's implied i.e. all resources match `#all` when it is used on a policy, and adding `#all` to a resource _must not_ effect a grant for all policies of a particular type to that resource, correct? Therefore, adding `#all` to a resource's role attributes never has any effect.

---

<div class="post-metadata">

**Author:** ![TheLumberjack](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/thelumberjack/32/113_2.png) [@TheLumberjack](https://openziti.discourse.group/u/TheLumberjack)\
**Post date:** [August 11, 2020, 5:13pm UTC](https://openziti.discourse.group/t/how-does-all-really-work/112/2 "2020-08-11T17:13:15Z")

</div>

> Therefore, adding `#all` to a resource’s role attributes never has any effect.

Correct. Adding `all` to a resource's role attributes has no effect

---

<div class="post-metadata">

**Author:** ![qrkourier](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/qrkourier/32/52_2.png) [@qrkourier](https://openziti.discourse.group/u/qrkourier)\
**Post date:** [August 11, 2020, 6:05pm UTC](https://openziti.discourse.group/t/how-does-all-really-work/112/3 "2020-08-11T18:05:53Z")

</div>

Would you also agree that `#all` only makes sense on a policy when there are no other role attributes because it overrides any other possible combination of role attributes?

---

<div class="post-metadata">

**Author:** ![plorenz](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/plorenz/32/54_2.png) [@plorenz](https://openziti.discourse.group/u/plorenz)\
**Post date:** [August 11, 2020, 6:30pm UTC](https://openziti.discourse.group/t/how-does-all-really-work/112/4 "2020-08-11T18:30:09Z")

</div>

Yes. Currently have #all means the policy will always match all related entities. It probably shouldn’t for policies with an AllOf semantic, but the expectation is that when using #all it will be the only role listed.

---

<div class="post-metadata">

**Author:** ![qrkourier](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/qrkourier/32/52_2.png) [@qrkourier](https://openziti.discourse.group/u/qrkourier)\
**Post date:** [October 29, 2021, 2:38am UTC](https://openziti.discourse.group/t/how-does-all-really-work/112/5 "2021-10-29T02:38:13Z")

</div>

You explained that assigning `#all` to a resource has no effect because it wouldn’t matter what the assigned roles were if there was a policy with `#all`, but I wonder if maybe doing this should get a BAD REQUEST (400) response because it seems likely to cause confusion to have a meaningless attribute in place. As expected, the management API already responds 400 if I try to assign multiple roles to a policy including `#all`.
