Skip to content

Document explicit permissions in the Sourcegraph API - #2083

Open
taras-yemets wants to merge 9 commits into
mainfrom
taras/explicit-permissions-sourcegraph-api
Open

taras-yemets wants to merge 9 commits into
mainfrom
taras/explicit-permissions-sourcegraph-api

Conversation

@taras-yemets

@taras-yemets taras-yemets commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The explicit permissions page only documented the GraphQL API. It now points to the Sourcegraph API (explicitrepopermissions.v1.Service) to grant, revoke, check, and list explicit permissions, with the required token scopes and REPO_PERMISSIONS permission, how to get a repository's numeric ID, and a link to /api-reference for request examples and schemas. The GraphQL sections stay as they were for what the Sourcegraph API doesn't support yet, with a note that setRepositoryPermissionsForUsers also removes permissions granted with the Sourcegraph API. The authentication and service accounts pages point to the Sourcegraph API too.

Closes SVC-2607

Companion PR: sourcegraph/sourcegraph#16836

Supersedes #1785

The explicit permissions page only described the GraphQL API, even though
Sourcegraph 7.4 added explicit repository permissions to the Sourcegraph API
(explicitrepopermissions.v1.Service).
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Oct 9, 2026 3:12pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Direct preview links to pages changed in this PR:

@github-actions

This comment has been minimized.

@taras-yemets
taras-yemets requested review from a team and bobheadxi October 9, 2026 15:11
@taras-yemets
taras-yemets marked this pull request as ready for review October 9, 2026 15:11
Comment on lines +49 to +57
The Sourcegraph API identifies repositories by numeric ID and cannot look them up by name yet. Get the ID with the [GraphQL API](/api/graphql):

```graphql
query {
repository(name: "github.example.com/owner/repo") {
databaseID
}
}
```

@bobheadxi bobheadxi Oct 9, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That we have to document this, feels like a product gap 👀 Users shouldn't have to switch back and forth between the two

@bobheadxi

Copy link
Copy Markdown
Member

We should also remove the GraphQL API docs for this

@marcleblanc2

Copy link
Copy Markdown
Contributor

We should also remove the GraphQL API docs for this

@bobheadxi before we do, we should build https://linear.app/sourcegraph/issue/SVC-2428/explicit-permissions-rest-api-for-lists-of-users-and-or-repos the new API endpoint to take in lists of repos and users, so we don’t need to overload both API client and server with individual requests for each user + repo pair.

@bobheadxi

Copy link
Copy Markdown
Member

@marcleblanc2 agreed, this should be usable without jumping between GraphQL and the external API, @taras-yemets is looking into the gaps with @pjlast

This branch was successfully deployed

1 active deployment
Preview — 66aa09f4 Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants