Restrict can_delete_contact permission to specific hierarchy for role

The CHWs are offline users.
That’s interesting, as in our runs the CHWs have always been able to see their peers.
See below screenshots where I logged in as a test CHW:


Do you believe this could be a fundamental fault in our hierarchy?
Our hierarchy structure is as follows

  1. NPO
    a) District health office (DHO)
  2. Team Area
    a) Team Lead
  3. Indawo
    a) CHW
  4. Plot/Location
  5. Household
    a) Household member

Our hierarchy in code:

"place_hierarchy_types": [
    "npo",
    "team_area",
    "indawo",
    "dwelling",
    "household"
  ],
  "contact_types": [
    {
      "id": "npo",
      "name_key": "contact.type.npo",
      "group_key": "contact.type.npo.plural",
      "create_key": "contact.type.npo.new",
      "edit_key": "contact.type.place.edit",
      "icon": "wcg-npo",
      "create_form": "form:contact:npo:create",
      "edit_form": "form:contact:npo:edit"
    },
    {
      "id": "dho",
      "name_key": "contact.type.dho",
      "group_key": "contact.type.dho.plural",
      "create_key": "contact.type.dho.new",
      "edit_key": "contact.type.dho.edit",
      "primary_contact_key": "contact.type.dho-primary",
      "parents": [
        "npo"
      ],
      "icon": "wcg-dho",
      "create_form": "form:contact:dho:create",
      "edit_form": "form:contact:dho:edit",
      "person": true
    },
    {
      "id": "team_area",
      "name_key": "contact.type.team_area",
      "group_key": "contact.type.team_area.plural",
      "create_key": "contact.type.team_area.new",
      "edit_key": "contact.type.place.edit",
      "parents": [
        "npo"
      ],
      "icon": "wcg-team_area",
      "create_form": "form:contact:team_area:create",
      "edit_form": "form:contact:team_area:edit"
    },
    {
      "id": "team_lead",
      "name_key": "contact.type.team_lead",
      "group_key": "contact.type.team_lead.plural",
      "create_key": "contact.type.team_lead.new",
      "edit_key": "contact.type.team_lead.edit",
      "primary_contact_key": "contact.type.team_lead-primary",
      "parents": [
        "team_area"
      ],
      "icon": "wcg-team_lead",
      "create_form": "form:contact:team_lead:create",
      "edit_form": "form:contact:team_lead:edit",
      "person": true
    },
    {
      "id": "indawo",
      "name_key": "contact.type.indawo",
      "group_key": "contact.type.indawo.plural",
      "create_key": "contact.type.indawo.new",
      "edit_key": "contact.type.place.edit",
      "parents": [
        "team_area"
      ],
      "icon": "wcg-indawo",
      "create_form": "form:contact:indawo:create",
      "edit_form": "form:contact:indawo:edit"
    },
    {
      "id": "chw",
      "name_key": "contact.type.chw",
      "group_key": "contact.type.chw.plural",
      "create_key": "contact.type.chw.new",
      "edit_key": "contact.type.chw.edit",
      "primary_contact_key": "contact.type.chw-primary",
      "parents": [
        "indawo"
      ],
      "icon": "wcg-chw",
      "create_form": "form:contact:chw:create",
      "edit_form": "form:contact:chw:edit",
      "person": true
    },
    {
      "id": "dwelling",
      "name_key": "contact.type.dwelling",
      "group_key": "contact.type.dwelling.plural",
      "create_key": "contact.type.dwelling.new",
      "edit_key": "contact.type.place.edit",
      "parents": [
        "indawo"
      ],
      "icon": "wcg-dwelling",
      "create_form": "form:contact:dwelling:create",
      "edit_form": "form:contact:dwelling:edit"
    },
    {
      "id": "household",
      "name_key": "contact.type.household",
      "group_key": "contact.type.household.plural",
      "create_key": "contact.type.household.new",
      "edit_key": "contact.type.household.edit",
      "parents": [
        "dwelling"
      ],
      "icon": "wcg-household",
      "create_form": "form:contact:household:create",
      "edit_form": "form:contact:household:edit",
      "count_visits": true
    },
    {
      "id": "hhm",
      "name_key": "contact.type.hhm",
      "group_key": "contact.type.hhm.plural",
      "create_key": "contact.type.hhm.new",
      "edit_key": "contact.type.hhm.edit",
      "primary_contact_key": "contact.type.hhm-primary",
      "parents": [
        "household"
      ],
      "icon": "wcg-hhm",
      "create_form": "form:contact:hhm:create",
      "edit_form": "form:contact:hhm:edit",
      "person": true
    }
  ]