File tree Expand file tree Collapse file tree
app/api/v2/organizations/[organizationId]/search/sources/[sourceId]/gitlab-permissions
packages/sim-cli/src/contract Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,6 +265,8 @@ API request and response schemas: [getGitLabSearchPermissions](/api-reference/or
265265
266266OAuth login or personal API key required.
267267
268+ This replaces both GitLab permission files. Readers omitted from the new grants lose access.
269+
268270``` bash
269271sim organizations gitlab-permissions replace < sourceId> [options]
270272```
@@ -289,6 +291,7 @@ sim organizations gitlab-permissions replace <sourceId> [options]
289291| ` --expected-revision <value> ` | Yes | Current permission revision obtained before generating this snapshot. |
290292| ` --user-mapping <json\|@file> ` | Yes | GitLab user IDs and their verified Sim email addresses. (JSON, or @path / @- to read a file or stdin). |
291293| ` --project-permissions <json\|@file> ` | Yes | GitLab project paths and the IDs of users granted access. (JSON, or @path / @- to read a file or stdin). |
294+ | ` -y, --yes ` | Yes | Confirm this operation. |
292295
293296</CommandTable >
294297
Original file line number Diff line number Diff line change @@ -4322,6 +4322,8 @@ API request and response schemas: [getGitLabSearchPermissions](/api-reference/or
43224322
43234323Replace GitLab search permission CSVs (OAuth login or personal API key required)
43244324
4325+ This replaces both GitLab permission files. Readers omitted from the new grants lose access.
4326+
43254327``` bash
43264328sim organizations gitlab-permissions replace < sourceId> [options]
43274329```
@@ -4346,6 +4348,7 @@ sim organizations gitlab-permissions replace <sourceId> [options]
43464348| ` --expected-revision <value> ` | Yes | Current permission revision obtained before generating this snapshot. |
43474349| ` --user-mapping <json\|@file> ` | Yes | GitLab user IDs and their verified Sim email addresses. (JSON, or @path / @- to read a file or stdin). |
43484350| ` --project-permissions <json\|@file> ` | Yes | GitLab project paths and the IDs of users granted access. (JSON, or @path / @- to read a file or stdin). |
4351+ | ` -y, --yes ` | Yes | Confirm this operation. |
43494352
43504353</CommandTable >
43514354
Original file line number Diff line number Diff line change 67466746 "bytes": 51,
67476747 "line": 201
67486748 },
6749+ {
6750+ "lang": "bash",
6751+ "meta": null,
6752+ "sha256": "f57b9272801ee426bbcac1ba0a76951bd50f0d66de23916fe7beffd36a8078d7",
6753+ "bytes": 61,
6754+ "line": 238
6755+ },
6756+ {
6757+ "lang": "bash",
6758+ "meta": null,
6759+ "sha256": "d28646b150b37f8c75a2ae8ab0ca07b698279c3b044530810a2f9096079d5ff9",
6760+ "bytes": 65,
6761+ "line": 270
6762+ },
67496763 {
67506764 "lang": "bash",
67516765 "meta": null,
1259512609 "bytes": 45,
1259612610 "line": 4259
1259712611 },
12612+ {
12613+ "lang": "bash",
12614+ "meta": null,
12615+ "sha256": "f57b9272801ee426bbcac1ba0a76951bd50f0d66de23916fe7beffd36a8078d7",
12616+ "bytes": 61,
12617+ "line": 4295
12618+ },
12619+ {
12620+ "lang": "bash",
12621+ "meta": null,
12622+ "sha256": "d28646b150b37f8c75a2ae8ab0ca07b698279c3b044530810a2f9096079d5ff9",
12623+ "bytes": 65,
12624+ "line": 4327
12625+ },
1259812626 {
1259912627 "lang": "bash",
1260012628 "meta": null,
@@ -177603,6 +177631,13 @@
177603177631 "sha256": "5c2ebfcc044ebc01c17a4af2664a4fbc667ae4916ef21555d90cfd9f245394bd",
177604177632 "bytes": 70,
177605177633 "line": 56
177634+ },
177635+ {
177636+ "lang": "yaml",
177637+ "meta": "title=\".gitlab-ci.yml\"",
177638+ "sha256": "cbd29bdea80fc9e1c908abaa8e708dd21435267b66be0583a033686a199b8882",
177639+ "bytes": 1046,
177640+ "line": 98
177606177641 }
177607177642 ],
177608177643 "links": [
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ import {
44} from '@/lib/api/contracts/v2/organizations'
55import { defineV2JsonRoute , v2ApiKeyAuth , v2RateLimits } from '@/lib/api/server/routes'
66import { v2OrganizationErrorPolicy } from '@/lib/api/server/routes/organizations'
7- import { gitLabSearchPermissionOperations } from '@/lib/knowledge/application/gitlab-search-permission-operations'
87import {
98 readGitLabSearchPermissions ,
109 replaceGitLabSearchPermissions ,
1110} from '@/lib/knowledge/application/gitlab-search-permissions'
11+ import { gitLabSearchPermissionOperations } from '@/lib/knowledge/application/operations'
1212
1313export const GET = defineV2JsonRoute ( {
1414 contract : v2GetGitLabSearchPermissionsContract ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import {
2323} from '@/lib/api/contracts/v2/organizations'
2424import { defineOpenApiRoute } from '@/lib/api/openapi/types'
2525import { invitationOperations } from '@/lib/invitations/application/operations'
26- import { gitLabSearchPermissionOperations } from '@/lib/knowledge/application/gitlab-search-permission- operations'
26+ import { gitLabSearchPermissionOperations } from '@/lib/knowledge/application/operations'
2727import { organizationOperations } from '@/lib/organizations/application/operations'
2828
2929const TIMESTAMP = '2026-06-01T09:00:00.000Z'
Original file line number Diff line number Diff line change 174174 "path" : " /api/v2/organizations/[organizationId]/permission-groups/[groupId]/members/bulk" ,
175175 "operation" : " permission_groups.members.bulk_add"
176176 },
177+ {
178+ "method" : " GET" ,
179+ "path" : " /api/v2/organizations/[organizationId]/search/sources/[sourceId]/gitlab-permissions" ,
180+ "operation" : " knowledge.search.gitlab_permissions.read"
181+ },
182+ {
183+ "method" : " PUT" ,
184+ "path" : " /api/v2/organizations/[organizationId]/search/sources/[sourceId]/gitlab-permissions" ,
185+ "operation" : " knowledge.search.gitlab_permissions.replace"
186+ },
177187 {
178188 "method" : " GET" ,
179189 "path" : " /api/v2/organizations/[organizationId]/sso/policy" ,
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { authorizeOrganizationOperation } from '@/lib/core/application/organizat
1414import { OrchestrationError } from '@/lib/core/orchestration/types'
1515import { resourceScopeCondition } from '@/lib/core/resource-scope.server'
1616import { isKnowledgeMemberAccessAvailable } from '@/lib/knowledge/access/availability'
17- import { gitLabSearchPermissionOperations } from '@/lib/knowledge/application/gitlab-search-permission- operations'
17+ import { gitLabSearchPermissionOperations } from '@/lib/knowledge/application/operations'
1818import { connectorIsLive } from '@/lib/knowledge/connectors/sync-lock'
1919import {
2020 lockOrganizationSearchApproval ,
Original file line number Diff line number Diff line change @@ -1031,6 +1031,23 @@ function defineKnowledgeSessionOperation<const Id extends string>(
10311031 return Object . freeze ( operation )
10321032}
10331033
1034+ export const gitLabSearchPermissionOperations = {
1035+ read : defineOrganizationOperation ( {
1036+ minimumRole : 'admin' ,
1037+ principalKinds : [ 'personal_api_key' , 'oauth_access_token' ] ,
1038+ capability : 'knowledge.use' ,
1039+ id : 'knowledge.search.gitlab_permissions.read' ,
1040+ oauthScope : 'api:read' ,
1041+ } ) ,
1042+ replace : defineOrganizationOperation ( {
1043+ minimumRole : 'admin' ,
1044+ principalKinds : [ 'personal_api_key' , 'oauth_access_token' ] ,
1045+ capability : 'knowledge.use' ,
1046+ id : 'knowledge.search.gitlab_permissions.replace' ,
1047+ oauthScope : 'api:write' ,
1048+ } ) ,
1049+ } as const
1050+
10341051export const knowledgeSessionOperations = {
10351052 // permission-group-exempt: delegates to knowledgeOperations.list, which carries knowledge.use
10361053 list : defineKnowledgeSessionOperation ( { id : 'knowledge.session.list' , capability : 'none' } ) ,
Original file line number Diff line number Diff line change 2828 " !scripts/test-desktop-inbox-e2e.ts" ,
2929 " !scripts/test-assistant-actions-e2e.ts" ,
3030 " !scripts/test-organization-search-e2e.ts" ,
31+ " !scripts/test-gitlab-csv-permissions-e2e.ts" ,
3132 " !scripts/test-docs-search-provider-e2e.ts" ,
3233 " !scripts/test-file-*-e2e.ts" ,
3334 " !scripts/test-landing-seo-e2e.ts" ,
180181 " !scripts/test-desktop-inbox-e2e.ts" ,
181182 " !scripts/test-assistant-actions-e2e.ts" ,
182183 " !scripts/test-organization-search-e2e.ts" ,
184+ " !scripts/test-gitlab-csv-permissions-e2e.ts" ,
183185 " !scripts/test-docs-search-provider-e2e.ts" ,
184186 " !scripts/test-file-*-e2e.ts" ,
185187 " !scripts/test-landing-seo-e2e.ts" ,
You can’t perform that action at this time.
0 commit comments