> 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/configuration-guides/access-control/context-conditions.md).

# Context conditions

Context conditions control when a permission applies based on how a resource is accessed. A resource can be accessed directly (e.g., starting a new case from the case list) or within the context of another resource (e.g., starting a process from within a case).

***

## Context modes

The Context section in the permission editor provides three modes:

<figure><img src="https://3330064618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq5dx9HWFJGshztp4binE%2Fuploads%2Fgit-blob-79dc5b247b2f475d95bae74f812078ddb980c937%2F01-no-restriction.png?alt=media" alt=""><figcaption><p>Context mode selector</p></figcaption></figure>

| Mode                     | Description                                                                                  |
| ------------------------ | -------------------------------------------------------------------------------------------- |
| **No restriction**       | Context is not considered — permission applies regardless of how the resource is accessed    |
| **Only without context** | Permission only applies when the resource is accessed directly, not within a parent resource |
| **Specific context**     | Permission only applies when accessed within a specific parent resource type                 |

***

## No restriction

The default mode. The permission applies whether the resource is accessed directly or within a parent resource. Context is ignored entirely.

Use this when the permission should apply universally, regardless of navigation path.

***

## Only without context

<figure><img src="https://3330064618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq5dx9HWFJGshztp4binE%2Fuploads%2Fgit-blob-1aacfacb44a8fd5b481448d44409ba4033632dc1%2F02-only-without-context.png?alt=media" alt=""><figcaption><p>Only without context mode</p></figcaption></figure>

The permission only applies when the resource is accessed on its own — not within any related resource.

### Example

A permission on `OperatonExecution` (process start) with "Only without context" would:

* **Apply** when starting a standalone process from the process overview
* **Not apply** when starting a process from within a case

***

## Specific context

<figure><img src="https://3330064618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq5dx9HWFJGshztp4binE%2Fuploads%2Fgit-blob-c64a6743cddaa3723ebc77a0ccc7fd91c7f41047%2F03-specific-context.png?alt=media" alt=""><figcaption><p>Specific context mode with resource selection</p></figcaption></figure>

The permission only applies when the resource is accessed within a specific parent resource type. You can optionally add conditions on the context resource to further restrict access.

### Configuration

| Property         | Description                                                                                                                           |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Context resource | The parent resource type that must be present                                                                                         |
| Conditions       | Optional conditions on the context resource (same syntax as regular [conditions](/configuration-guides/access-control/conditions.md)) |

### Example

A permission on `OperatonExecution` (process start) with context resource `CaseDefinition` and a condition `id.key = bezwaar` would allow processes to only be started within the context of a specific case type:

<figure><img src="https://3330064618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq5dx9HWFJGshztp4binE%2Fuploads%2Fgit-blob-89095123e30d6d9878d7d0134d86d721780c7684%2F04-specific-context-with-condition.png?alt=media" alt=""><figcaption><p>Specific context with condition configured</p></figcaption></figure>

* **Apply** when starting a process from within a "bezwaar" case
* **Not apply** when starting a process from other case types
* **Not apply** when starting a process without a case context
