From 3a8caee9ce02a18672c74099bde34bfaea32c74b Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 21 Apr 2026 16:19:10 +0200 Subject: [PATCH 1/5] feat: add @libre.graph.permissions.actions.allowedValues to driveItem Adds an optional, `$select`-gated instance annotation on `driveItem` that carries the list of libre.graph actions the caller is allowed to perform on the item. Mirrors the annotation of the same name on the `/permissions` endpoint so clients (e.g. a sharing dialog in a search/listing UI) can get the effective-actions view inline without a separate round-trip per item. - Adds `@libre.graph.permissions.actions.allowedValues` to the `driveItem` schema, marked read-only and documented as only populated when requested. - Adds a reusable `driveItemSelect` component parameter with a narrow enum, following the same pattern as PR #38 (feat/download-url). When both land, the enum values merge. - Wires the new parameter to `GetDriveItem`. Rationale discussed in #34. --- api/openapi-spec/v1.0.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index c8e2708..217fb38 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -4990,6 +4990,21 @@ components: '@UI.Hidden': description: Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissions. type: boolean + '@libre.graph.permissions.actions.allowedValues': + type: array + description: | + A list of actions the caller is allowed to perform on this item. + + Only returned when explicitly requested via `$select` on endpoints + that support it. Mirrors the annotation of the same name on the + `/permissions` endpoint, allowing clients to learn a caller's + effective actions on an item without a separate round-trip. + + See the `/permissions` endpoint for the mapping between CS3 + `ResourcePermissions` and libre.graph actions. + items: + type: string + readOnly: true sharingLinkType: type: string enum: [ internal, view, upload, edit, createOnly, blocksDownload ] @@ -5987,7 +6002,10 @@ components: driveItemSelect: name: $select in: query - description: Select additional properties to be returned. + description: | + Select properties to be returned. By default all properties are returned, except for + instance annotations (prefixed with `@`) that are computationally expensive or + short-lived. Instance annotations must be explicitly requested via `$select`. style: form explode: false schema: @@ -5996,11 +6014,15 @@ components: items: enum: - '@microsoft.graph.downloadUrl' + - '@libre.graph.permissions.actions.allowedValues' type: string examples: request download url: value: - '@microsoft.graph.downloadUrl' + request allowed actions: + value: + - '@libre.graph.permissions.actions.allowedValues' drivesFilter: name: $filter in: query From 9a0600a90294e75b62abcb9f753eb2a503cc83c5 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 21 Apr 2026 16:22:51 +0200 Subject: [PATCH 2/5] fix: drop implementation-layer reference from description --- api/openapi-spec/v1.0.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 217fb38..acda9ae 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -4999,9 +4999,6 @@ components: that support it. Mirrors the annotation of the same name on the `/permissions` endpoint, allowing clients to learn a caller's effective actions on an item without a separate round-trip. - - See the `/permissions` endpoint for the mapping between CS3 - `ResourcePermissions` and libre.graph actions. items: type: string readOnly: true From 61c82718ed86c8371b8d7e6bdb0b425d74f8b9fa Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 21 Apr 2026 16:23:39 +0200 Subject: [PATCH 3/5] fix: simplify driveItemSelect description --- api/openapi-spec/v1.0.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index acda9ae..39f1541 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -5999,10 +5999,7 @@ components: driveItemSelect: name: $select in: query - description: | - Select properties to be returned. By default all properties are returned, except for - instance annotations (prefixed with `@`) that are computationally expensive or - short-lived. Instance annotations must be explicitly requested via `$select`. + description: Instance annotations to include in the response. style: form explode: false schema: From 488396d0ecb30cf9fb6359aaa96d124d57c8ef9e Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 21 Apr 2026 16:25:18 +0200 Subject: [PATCH 4/5] fix: reword driveItemSelect description --- api/openapi-spec/v1.0.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 39f1541..6a317da 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -5999,7 +5999,7 @@ components: driveItemSelect: name: $select in: query - description: Instance annotations to include in the response. + description: Select additional properties to be returned. style: form explode: false schema: From 0cc580bb74be8387e1a9721facdc75410e1a3f03 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Wed, 22 Apr 2026 01:05:52 +0200 Subject: [PATCH 5/5] feat: wire driveItemSelect to GetRoot, HomeGetRoot and HomeGetChildren --- api/openapi-spec/v1.0.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/openapi-spec/v1.0.yaml b/api/openapi-spec/v1.0.yaml index 6a317da..e1a182f 100644 --- a/api/openapi-spec/v1.0.yaml +++ b/api/openapi-spec/v1.0.yaml @@ -2100,6 +2100,7 @@ paths: schema: type: string x-ms-docs-key-type: drive + - $ref: '#/components/parameters/driveItemSelect' responses: '200': description: Retrieved resource @@ -2430,6 +2431,8 @@ paths: - me.drive.root summary: Get root from personal space operationId: HomeGetRoot + parameters: + - $ref: '#/components/parameters/driveItemSelect' responses: '200': description: Retrieved resource @@ -2446,6 +2449,8 @@ paths: - me.drive.root.children summary: Get children from drive operationId: HomeGetChildren + parameters: + - $ref: '#/components/parameters/driveItemSelect' responses: '200': description: Retrieved resource list