# Restrict can\_delete\_contact permission to specific hierarchy for role

**URL:** <https://forum.communityhealthtoolkit.org/t/restrict-can-delete-contact-permission-to-specific-hierarchy-for-role/3290>\
**Category:** Development\
**Tags:** permissions, configuration, roles\
**Created:** [January 29, 2024, 8:28am UTC](https://forum.communityhealthtoolkit.org/t/restrict-can-delete-contact-permission-to-specific-hierarchy-for-role/3290 "2024-01-29T08:28:10Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [August 1, 2024, 8:31pm UTC](https://forum.communityhealthtoolkit.org/t/restrict-can-delete-contact-permission-to-specific-hierarchy-for-role/3290/21 "2024-08-01T20:31:58Z")

</div>

I expect it is actually the `reduce` function that is complicating things for you here. I think your first entry (where you get the object with `"value": 20`) is more or less what I would expect to see from a plain query of the view (because all of the mapped entries get reduced down to just the `_count`).

This is what it looks like to me to open the view in Fauxton (can see the doc ids of the conflicted docs):

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/7/7a866bbc354ca2eb848f826dacad7745229aa1bf.png)

However, if you just want to hit the view endpoint directly (e.g. with curl), you should set the `reduce=false` query parameter and [as noted in the Couch docs](https://docs.couchdb.org/en/stable/api/ddoc/views.html#db-design-design-doc-view-view-name) you will just get back all the mapped values (`/medic/_design/medic-conflicts/_view/conflicts?reduce=false`)

[Previous page](https://forum.communityhealthtoolkit.org/t/restrict-can-delete-contact-permission-to-specific-hierarchy-for-role/3290.md?page=1)
