> For the complete documentation index, see [llms.txt](https://docs.valtimo.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valtimo.nl/features/keycloak/access-control.md).

# Access control

{% hint style="success" %}
Available since Valtimo `13.20.0`.
{% endhint %}

Access to users in the `UserResource` can be configured through access control. More information about access control can be found in the [access control documentation](/features/access-control.md).

### Resources and actions

<table><thead><tr><th width="329">Resource type</th><th width="143">Action</th><th>Effect</th></tr></thead><tbody><tr><td><code>com.ritense.valtimo.contract.authentication.User</code></td><td><code>view_list</code></td><td>Allows viewing the list of users or searching for users</td></tr><tr><td></td><td><code>view</code></td><td>Allows viewing details of a single user</td></tr></tbody></table>

### Examples

#### Permission to view and list users for ROLE\_ADMIN

```json
[
    {
        "resourceType": "com.ritense.valtimo.contract.authentication.User",
        "actions": [
            "view_list",
            "view"
        ],
        "roleKey": "ROLE_ADMIN"
    }
]
```

#### Permission to view and list users for ROLE\_USER with a condition

The following example allows users with `ROLE_USER` to view and list users, but only those users who also have the `ROLE_USER` role.

```json
[
    {
        "resourceType": "com.ritense.valtimo.contract.authentication.User",
        "actions": [
            "view_list",
            "view"
        ],
        "roleKey": "ROLE_USER",
        "conditions": [
            {
                "type": "field",
                "field": "roles",
                "operator": "list_contains",
                "value": "ROLE_USER"
            }
        ]
    }
]
```

This permission supports the following condition fields:

* `roles`: The list of roles assigned to the user.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.valtimo.nl/features/keycloak/access-control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
