Issue:
feat(users): Add entity type filter in list users and list roles API

Currently list users and list roles API is sending all the users and roles respectively for those who are same entity level and less.

We need to add filters in these APIs to send users and roles who are only at particular entity level.

Resolution:
<think>
PR Context:
- Title: feat(users): Add entity type filter in list users and list roles API
- Merged: 2024-09-24T14:43:55Z
- Files changed: 7 files
- Commits: 5 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
- Adds entity_type filter in list users and list roles API.

### Additional Changes

- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variable
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(users): Add entity type filter in list users and list roles API (#5997)
Files to modify:


**crates/api_models/src/events/user_role.rs**
  Modify existing code

**crates/api_models/src/user_role.rs**
  Add:
    - struct: pub::ListUsersInEntityRequest

**crates/api_models/src/user_role/role.rs**
  Add:
    - struct: pub::ListRolesRequest

**crates/router/src/core/user_role.rs**
  Modify existing code

**crates/router/src/core/user_role/role.rs**
  Modify existing code

**crates/router/src/routes/user_role.rs**
  Modify existing code

**crates/router/src/utils/user_role.rs**
  Add:
    - function: pub::fetch_user_roles_by_payload
    - function: pub::get_min_entity