Skip to content

Commit 6898869

Browse files
committed
write + delete ActorDefinitionWorkspaceGrant
1 parent 40d3985 commit 6898869

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

airbyte-config/persistence/src/main/java/io/airbyte/config/persistence/ConfigRepository.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,20 @@ private <T> Entry<T, Boolean> actorDefinitionWithGrantStatus(final Record outerJ
415415
return Map.entry(actorDefinition, granted);
416416
}
417417

418+
public void writeActorDefinitionWorkspaceGrant(final UUID actorDefinitionId, final UUID workspaceId) throws IOException {
419+
database.query(ctx -> ctx.insertInto(ACTOR_DEFINITION_WORKSPACE_GRANT)
420+
.set(ACTOR_DEFINITION_WORKSPACE_GRANT.ACTOR_DEFINITION_ID, actorDefinitionId)
421+
.set(ACTOR_DEFINITION_WORKSPACE_GRANT.WORKSPACE_ID, workspaceId)
422+
.execute());
423+
}
424+
425+
public void deleteActorDefinitionWorkspaceGrant(final UUID actorDefinitionId, final UUID workspaceId) throws IOException {
426+
database.query(ctx -> ctx.deleteFrom(ACTOR_DEFINITION_WORKSPACE_GRANT)
427+
.where(ACTOR_DEFINITION_WORKSPACE_GRANT.ACTOR_DEFINITION_ID.eq(actorDefinitionId))
428+
.and(ACTOR_DEFINITION_WORKSPACE_GRANT.WORKSPACE_ID.eq(workspaceId))
429+
.execute());
430+
}
431+
418432
/**
419433
* Returns source with a given id. Does not contain secrets. To hydrate with secrets see { @link
420434
* SecretsRepositoryReader#getSourceConnectionWithSecrets(final UUID sourceId) }.

0 commit comments

Comments
 (0)