Registry stack documentation: machine-readable Markdown.
Index of all pages: https://docs.registrystack.org/llms.txt
Full corpus: https://docs.registrystack.org/llms-full.txt

# Inspect access profiles as ODRL

> Export a conservative ODRL 2.2 description of the record-read permissions in a Base Registry Engine project, with a coverage report that explains every omitted grant.

Use `bregctl generate odrl` to inspect a conservative description of your configured Record-read permissions in Base Registry Engine (BReg).
The exporter derives ODRL 2.2 JSON-LD from the compiled project and writes a coverage report explaining omitted grants.
It does not contact a running registry or read Records.

```sh
bregctl generate odrl ./my-registry --output ./access-policy-review
```

To inspect one access profile, add `--access-profile PROFILE`.
Without that option, the exporter considers every compiled Record access profile.
An unknown profile is refused before any output is written.
The output directory must be new, as for other `generate` commands.

The command writes:

| File under the output directory | Purpose |
|---|---|
| `generated/odrl/policies.jsonld` | Partial ODRL policies for supported grants |
| `generated/odrl/coverage.json` | Every considered Record-operation grant and its outcome |
| `generated/odrl/profile.jsonld` | The vocabulary and interpretation rules consumers need |

These are operator-review artifacts.
They can include non-public Record types, field names, profile identifiers, and token requirements, so review the files before sharing them.
This command does not apply the public `manifestProjection` filter, publish an endpoint, or replace Manifest and DCAT generation.

{/* Evidence: crates/registry-bregctl/tests/odrl_cli.rs
    odrl_cli_exports_supported_reads_and_reports_omissions,
    odrl_cli_unknown_profile_and_irrelevant_flags_refuse_before_writing;
    crates/registry-breg/src/odrl_export.rs. */}

## What is translated

The supported subset is `get` and `list` on current Records with unrestricted row reach.
Each permission targets a named projection containing exactly the profile's readable fields.
The native Registry Record envelope is outside that field list.
Every rule preserves the selected profile, exact operation, authentication, principal-claim requirement, required scopes, permitted purposes, requester-client restrictions, and actor-kind restriction.
It also preserves native trusted-actor requirements and requires the caller context to carry no task grant.
These implicit admission rules apply even when the source does not spell them out as separate restrictions.

Required scopes are conjunctive: every configured scope is required.
Permitted purposes and requester clients are alternatives: one listed value must match.
Conditions refer to BReg's verified caller context, so a caller supplying a profile name or purpose value does not establish authority.

The exporter uses `odrl:read` with the documented BReg profile at `https://id.registrystack.org/profiles/breg-odrl/v1`.
This is an experimental local profile, not a claim of interoperability with every ODRL consumer.
Consumers must understand its terms, particularly the projected target and exact native operation.
The shipped `profile.jsonld` defines those terms without requiring a network fetch.

{/* Evidence: crates/registry-breg/tests/odrl_export.rs
    supported_reads_preserve_profile_conditions_and_projection_fields,
    task_grant_mutant_is_not_broadened_and_profile_selection_is_exact;
    crates/registry-breg/src/odrl_export.rs. */}

## Eclipse EDC compatibility

This export is neither an Eclipse EDC Management API `PolicyDefinition` nor a Dataspace Protocol Offer or Agreement.
It has not been imported into or evaluated by EDC.
Do not import it by wrapping a generated policy in `PolicyDefinition`.
The reviewed EDC parser reads permission actions, constraints, and duties but drops rule-level targets.
That loses the BReg projection identifier, Record type, and readable-field list, which define the permission's scope, and a successful parse would not establish equivalent behaviour.

An EDC adapter would need to preserve every projection and its exact operation, normalise JSON-LD list operands, bind `odrl:read` in each applicable evaluation scope, and register functions for every BReg constraint.
Those functions must use BReg's verified caller context and refuse absent, unsupported, or unverifiable conditions.
BReg would still authorise the actual request.
The exporter includes no such adapter or EDC extension.

These limits were checked against EDC's [policy-definition schema](https://github.com/eclipse-edc/Connector/blob/cd7e556d365cd3e7195e5728cb9bf695c483599d/extensions/common/api/management-api-schema-validator/src/main/resources/schema/management/v4/policy-definition-schema.json), [permission transformer](https://github.com/eclipse-edc/Connector/blob/cd7e556d365cd3e7195e5728cb9bf695c483599d/core/control-plane/control-plane-transform/src/main/java/org/eclipse/edc/connector/controlplane/transform/odrl/to/JsonObjectToPermissionTransformer.java), and [policy-engine contract](https://github.com/eclipse-edc/Connector/blob/cd7e556d365cd3e7195e5728cb9bf695c483599d/spi/control-plane-spi/src/main/java/org/eclipse/edc/policy/engine/spi/PolicyEngine.java).

## What is omitted

A permission with row boundaries, current-membership requirements, subject consent requirements, a task grant, a disclosure condition that binds the profile, or a profile that sets `requireAccessReason` is omitted in full. The reasons for the last two are `disclosure-condition` and `access-reason`.
A `list` permission whose grant sets `requiredFilters` is omitted with the reason `required-filters`, because ODRL has no term for the filter a list must pin.
The `get` permission of the same grant is still exported.
The exporter never removes an unsupported restriction to produce a broader permission.
Operations other than `get` and `list` are omitted as unsupported.

Actions, Proposals, statistical datasets, lookup grants, relationship paths, historical reads, count requests, and data export are outside the supported surface.
Their absence is not a prohibition and does not mean BReg lacks them.

`coverage.json` counts Record-operation grants, after any profile selection.
A profile granting `get`, `list`, and `patch` contributes three candidates.
The report identifies each exported or omitted candidate and gives reasons for omissions.
Its totals are not a percentage of the registry's entire authorisation model.
Reasons can overlap when one grant has several unsupported restrictions.

Zero supported grants is a successful, explicit empty export.
It produces an empty policy collection and a coverage report, never an unconditional default permission.
Invalid source, an unknown selected profile, or a failed write remains an error.

{/* Evidence: crates/registry-breg/tests/odrl_export.rs
    row_membership_and_consent_restrictions_omit_the_complete_read_grant,
    exact_selection_of_known_action_only_profile_is_empty_and_valid;
    crates/registry-bregctl/tests/odrl_cli.rs
    odrl_cli_zero_coverage_is_explicit_and_does_not_fabricate_permissions. */}

## Use the result

Treat the policies as a partial description of source configuration.
The source revision identifies what was inspected; it does not prove that the package is active.
BReg continues to authenticate and authorise every request using its current package and state.
The export does not describe downstream usage obligations that were never present in the access profiles.

For application discovery, use the caller-filtered [registry metadata](../breg-api/#registry-metadata) endpoint.
For a publication intended for anonymous readers, use the separate classified Manifest projection and review any policy you attach to that offering.

Standards references: [ODRL Information Model 2.2](https://www.w3.org/TR/odrl-model/), [ODRL Vocabulary and Expression 2.2](https://www.w3.org/TR/odrl-vocab/), and [ODRL Profile Best Practices](https://www.w3.org/community/reports/odrl/CG-FINAL-profile-bp-20240808.html#profile-vocab).

## Next

- [Base Registry Engine API reference](../breg-api/)
- [Control access and reads](../../configure/breg-access/)
- [Base Registry Engine configuration reference](../breg-configuration/)