fix(core): Fix PermissionChecker.check, and add additional unit tests (#8528)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-02-02 12:21:53 +01:00
committed by GitHub
parent 612771e032
commit 5832d3ca46
6 changed files with 520 additions and 378 deletions

View File

@@ -22,6 +22,15 @@ export class SharedWorkflowRepository extends Repository<SharedWorkflow> {
return await this.exist({ where });
}
/** Get the IDs of all users this workflow is shared with */
async getSharedUserIds(workflowId: string) {
const sharedWorkflows = await this.find({
select: ['userId'],
where: { workflowId },
});
return sharedWorkflows.map((sharing) => sharing.userId);
}
async getSharedWorkflowIds(workflowIds: string[]) {
const sharedWorkflows = await this.find({
select: ['workflowId'],