Skip to content

fix(graph): expose allowedValues on driveItem children - #3476

Open
dschmidt wants to merge 2 commits into
mainfrom
fix/graph-children-allowed-values
Open

fix(graph): expose allowedValues on driveItem children#3476
dschmidt wants to merge 2 commits into
mainfrom
fix/graph-children-allowed-values

Conversation

@dschmidt

@dschmidt dschmidt commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

$select=@libre.graph.permissions.actions.allowedValues is filled by GetRootDriveChildren and GetDriveItem, but not by the shared children listing behind /children and $expand=children. Every child came back without its allowed actions, so a client that derives permissions from them treats the whole listing as read only (no download, rename, delete).

It went unnoticed because the single-item stat always carried them and $expand=children is new.

  • listDriveItemChildren fills allowedValues now, via a setDriveItem(s)AllowedValues helper pair that mirrors the thumbnails and shareTypes shape; the CS3-to-libregraph action mapping lives in one place.
  • GetRootDriveChildren delegates to listDriveItemChildren instead of repeating its ListContainer + format + shareTypes tail, so root children gain the same annotations from one code path.

Behaviour change: permission denied on /me/drive/root/children now answers 404 instead of 403, matching the item children endpoint and the TODO that sat on that line. The spec documents only 200 plus a generic default error for both endpoints, so no spec change is needed.

@codacy-production

codacy-production Bot commented Sep 7, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 93.75% diff coverage · -0.01% coverage variation

Metric Results
Coverage variation -0.01% coverage variation (-1.00%)
Diff coverage 93.75% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d6c6b6f) 88333 20805 23.55%
Head commit (b8eb8f8) 88310 (-23) 20792 (-13) 23.54% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3476) 16 15 93.75%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@dschmidt
dschmidt force-pushed the fix/graph-children-allowed-values branch 3 times, most recently from 5af6b43 to d1ef47d Compare September 7, 2026 06:33
@dschmidt
dschmidt requested a review from butonic September 7, 2026 06:36
@dschmidt
dschmidt marked this pull request as ready for review September 7, 2026 06:36
@dschmidt
dschmidt force-pushed the fix/graph-children-allowed-values branch from d1ef47d to 7dda440 Compare September 7, 2026 10:55
GetRootDriveChildren and GetDriveItem fill
@libre.graph.permissions.actions.allowedValues on $select, the shared
children listing did not, so every child in /children and $expand=children
came back without its allowed actions and clients treated the listing as read
only. Add a setDriveItem(s)AllowedValues helper pair, matching the thumbnails
and shareTypes shape, and apply it in the listing.

GetRootDriveChildren now delegates to the shared children listing instead of
repeating its ListContainer + format + shareTypes tail; permission denied on
the root listing answers 404 like the item children endpoint (the TODO that
sat there), not 403.
@dschmidt
dschmidt force-pushed the fix/graph-children-allowed-values branch from 7dda440 to b8eb8f8 Compare September 7, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant