feat: add @libre.graph.permissions.actions.allowedValues to driveItem#39
Open
feat: add @libre.graph.permissions.actions.allowedValues to driveItem#39
Conversation
micbar
reviewed
Apr 21, 2026
Member
micbar
left a comment
There was a problem hiding this comment.
I like the idea!
This needs a rebase.
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.
75dc97c to
488396d
Compare
Contributor
Author
|
Rebased |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional,
$select-gated instance annotation ondriveItemthat carries the list of libre.graph actions the caller is allowed to perform on an item. Mirrors the annotation of the same name on the/permissionsendpoint so clients can get the effective-actions view inline without a separate round-trip per item.Motivated by the discussion on #34 (search endpoint) — a sharing dialog rendered over search / listing results shouldn't need to fan out one
/permissionscall per hit just to know what the caller can do with each result.Changes
@libre.graph.permissions.actions.allowedValuesto thedriveItemschema, read-only, populated only when explicitly requested via$select.driveItemSelectcomponent parameter (introduced by feat: Add @microsoft.graph.downloadUrl annotation and /content endpoi… #38) with the new enum value and a matching example.driveItemSelectto every endpoint that returns adriveItemdirectly:GetDriveItem,GetRoot,HomeGetRoot,HomeGetChildren.Only actions, not roles, for now — roles are a curated bundle concept primarily useful for building a sharing-role picker and can be added in a follow-up if needed. Actions carry the full-fidelity permission info, equivalent (at finer granularity) to the WebDAV short-string we already produce today in search results.
Notes on scope
ListSharedByMe,ListSharedWithMe) are intentionally skipped. Their descriptions already promise that thepermissionsrelation is always returned inline, so the opt-inallowedValuesannotation would be redundant there.$selectsemantics here are narrower than OData's. The enum is constrained to specific opt-in instance annotations, and selecting a value adds it to the default response rather than restricting the response to only the selected fields. This matches the pattern established by feat: Add @microsoft.graph.downloadUrl annotation and /content endpoi… #38'sdriveItemSelectand the existingpermissionsSelectparameter on/permissions. Spec consistency within libre-graph-api wins over strict OData fidelity for this case.remoteItem. The outerdriveItemis sufficient for the common sharedWithMe case because the mountpoint stat already carries the caller's effective permissions on the underlying resource. If that assumption breaks we can add it toremoteItemin a follow-up.