Repository navigation
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 34 |
🟢 Coverage 31.95% diff coverage · +0.01% coverage variation
Metric Results Coverage variation ✅ +0.01% coverage variation (-1.00%) Diff coverage ✅ 31.95% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (83615f2) Report Missing Report Missing Report Missing Head commit (64a1ac8) 92809 (+169) 25477 (+59) 27.45% (+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 (#3928) 169 54 31.95% 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%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
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.
Assisted-by: Claude Code:claude-opus-5-5
7acbbde to
64a1ac8
Compare
Description
Adds endpoints to retrieve a single sharing permission via the Graph API:
GET /graph/v1beta1/drives/{driveID}/items/{itemID}/permissions/{permissionID}GET /graph/v1beta1/drives/{driveID}/root/permissions/{permissionID}Both endpoints reuse
ListPermissionsand return the permission with the requested ID. As a result, a permission can be retrieved only if it is also visible in the corresponding permission listing for the same user. If no matching permission is found, the endpoints return404 itemNotFound.The space-root endpoint supports project spaces only, consistent with the existing
DELETEandPATCHspace-root permission endpoints. Requests for personal or virtual spaces return400 invalidRequestwithunsupported space type.ListSpaceRootPermissionsand all other existing endpoints are unchanged.Error handling follows the existing permission handlers:
400for malformed IDs,404when the item does not belong to the drive.422for an invaliddriveID.400for an empty or invalidpermissionID.Related Issue
Motivation and Context
Clients could only list all permissions of a drive item or space root, or update and delete a single permission. There was no way to retrieve a single permission by ID. The OpenCloud Libre Graph API specification already defines both single-permission GET operations, but the Graph service did not implement their corresponding HTTP handlers and routes. Requests to these endpoints previously returned 405 Method Not Allowed.
Web-client impact
Additive only: no existing Graph route, response or status code changes, and no web change is required. The web client's existing
permissions.getPermissionwrapper (item endpoint) previously received405and will now return the permission.Logging and tracing (follow-up)
The new endpoints are not instrumented with the logging and tracing introduced in #3881, because #3881 has not been merged yet. This is tracked in a separate follow-up issue and will be added once #3881 is merged.
GetPermissionandGetSpaceRootPermissionHow Has This Been Tested?
405.itemNotFoundwithout falling back to a direct share lookup; Stat errors are propagated; personal and virtual spaces are rejected.permissionIDdecoding, and the400,404and422responses.go test ./services/graph/...passes in all 11 packages, including all 482service/v0specs.go test -race ./services/graph/pkg/service/v0/passes.golangci-lintreports 0 new issues compared with related base branch.gofmtandgit diff --checkare clean.apiSharingNg1/listPermissions.feature, "user gets a single link permission of a project space using root endpoint".make test-php-style. The changed PHP files passphp -lonly. CI will be the first to run both.Types of changes
Checklist:
AI assistance: Claude Code (claude-opus-5-5) wrote the first draft of the code and the tests.