"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ability_1 = require("@casl/ability");
const projects_1 = require("../types/projects");
const space_1 = require("../types/space");
const projectMemberAbility_1 = require("./projectMemberAbility");
const projectMemberAbility_mock_1 = require("./projectMemberAbility.mock");
const { projectUuid } = projectMemberAbility_mock_1.PROJECT_VIEWER;
const defineAbilityForProjectMember = (member) => {
    const builder = new ability_1.AbilityBuilder(ability_1.Ability);
    if (member) {
        projectMemberAbility_1.projectMemberAbilities[member.role](member, builder);
    }
    return builder.build();
};
describe('Project member permissions', () => {
    describe('Member permissions', () => {
        let ability = defineAbilityForProjectMember(projectMemberAbility_mock_1.PROJECT_ADMIN);
        describe('when user is an project admin', () => {
            beforeEach(() => {
                ability = defineAbilityForProjectMember(projectMemberAbility_mock_1.PROJECT_ADMIN);
            });
            it('can view and manage all kinds of dashboards', () => {
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
            });
            it('can view and manage all kinds of saved charts', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
            });
            it('can view and manage all kinds of space', () => {
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
            });
            it('can manage other types of public resources', () => {
                expect(ability.can('manage', (0, ability_1.subject)('Project', { projectUuid }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Job', { projectUuid }))).toEqual(true);
            });
            it('cannot view resources from another projectUuid', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Project', { projectUuid: '5678' }))).toEqual(false);
            });
            describe('JobStatus', () => {
                it('can view his own job status', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        createdByUserUuid: projectMemberAbility_mock_1.PROJECT_ADMIN.userUuid,
                    }))).toEqual(true);
                });
                it('can view job status from another user', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                        createdByUserUuid: 'another-admin-user-4567',
                    }))).toEqual(true);
                });
                it('can view job status from the project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                        createdByUserUuid: undefined,
                    }))).toEqual(true);
                });
                it('cannot view job status from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', { projectUuid: '5678' }))).toEqual(false);
                });
                it('cannot view job status with undefined details', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid: undefined,
                        organizationUuid: undefined,
                    }))).toEqual(false);
                });
            });
            describe('AiAgent', () => {
                it('can manage AiAgent', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(true);
                });
                it('cannot manage AiAgent from another project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgent', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('AiAgentThread', () => {
                it('can view all AiAgentThreads in the project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', { projectUuid }))).toEqual(true);
                });
                it('can manage all AiAgentThreads in the project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', { projectUuid }))).toEqual(true);
                });
                it('cannot view AiAgentThread from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
                });
                it('cannot manage AiAgentThread from another project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('ScheduledDeliveries', () => {
                it('can create ScheduledDeliveries', () => {
                    expect(ability.can('create', (0, ability_1.subject)('ScheduledDeliveries', { projectUuid }))).toEqual(true);
                });
                it('can manage all ScheduledDeliveries', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', { projectUuid }))).toEqual(true);
                });
                it('can manage ScheduledDeliveries created by other users', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(true);
                });
                it('cannot manage ScheduledDeliveries from another project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid: '5678',
                    }))).toEqual(false);
                });
            });
        });
        describe('when user is an editor', () => {
            beforeEach(() => {
                ability = defineAbilityForProjectMember(projectMemberAbility_mock_1.PROJECT_EDITOR);
            });
            it('can view and manage public & accessible dashboards', () => {
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
            });
            it('can view and manage public & accessable saved charts', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
            });
            it('can create a space', () => {
                expect(ability.can('create', (0, ability_1.subject)('Space', {
                    projectUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.projectUuid,
                }))).toEqual(true);
            });
            it('can view and manage public & accessable space', () => {
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                            role: space_1.SpaceMemberRole.ADMIN,
                        },
                    ],
                }))).toEqual(true);
            });
            it('can view other public resources', () => {
                expect(ability.can('view', (0, ability_1.subject)('Project', { projectUuid }))).toEqual(true);
            });
            it('can manage other public resources', () => {
                expect(ability.can('manage', (0, ability_1.subject)('Job', { projectUuid }))).toEqual(true);
            });
            it('cannot manage projects', () => {
                expect(ability.can('manage', (0, ability_1.subject)('Project', { projectUuid }))).toEqual(false);
            });
            it('can download CSV', () => {
                expect(ability.can('manage', (0, ability_1.subject)('ExportCsv', { projectUuid }))).toEqual(true);
            });
            it('can change csv results', () => {
                expect(ability.can('manage', (0, ability_1.subject)('ChangeCsvResults', { projectUuid }))).toEqual(true);
            });
            it('cannot use SQL runner', () => {
                expect(ability.can('manage', (0, ability_1.subject)('SqlRunner', { projectUuid }))).toEqual(false);
            });
            it('can use the SemanticViewer', () => {
                expect(ability.can('view', (0, ability_1.subject)('SemanticViewer', { projectUuid }))).toEqual(true);
            });
            describe('JobStatus', () => {
                it('can view his own job status', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                        createdByUserUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                    }))).toEqual(true);
                });
                it('cannot view job status from the project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                        createdByUserUuid: undefined,
                    }))).toEqual(false);
                });
                it('cannot view job status from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('AiAgent', () => {
                it('can view AiAgent', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(true);
                });
                it('cannot manage AiAgent', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(false);
                });
                it('cannot view AiAgent from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgent', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('AiAgentThread', () => {
                it('can view only his own AiAgentThread', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                    }))).toEqual(true);
                });
                it('can manage only his own AiAgentThread', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                    }))).toEqual(true);
                });
                it('cannot view other users AiAgentThread', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot manage other users AiAgentThread', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot view AiAgentThread from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('ScheduledDeliveries', () => {
                it('can create ScheduledDeliveries', () => {
                    expect(ability.can('create', (0, ability_1.subject)('ScheduledDeliveries', { projectUuid }))).toEqual(true);
                });
                it('can manage only his own ScheduledDeliveries', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_EDITOR.userUuid,
                    }))).toEqual(true);
                });
                it('cannot manage ScheduledDeliveries created by other users', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot manage ScheduledDeliveries from another project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid: '5678',
                    }))).toEqual(false);
                });
            });
        });
        describe('when user is an developer', () => {
            beforeEach(() => {
                ability = defineAbilityForProjectMember(projectMemberAbility_mock_1.PROJECT_DEVELOPER);
            });
            it('can use SQL runner', () => {
                expect(ability.can('manage', (0, ability_1.subject)('SqlRunner', { projectUuid }))).toEqual(true);
            });
            it('can use the SemanticViewer', () => {
                expect(ability.can('view', (0, ability_1.subject)('SemanticViewer', { projectUuid }))).toEqual(true);
            });
            describe('JobStatus', () => {
                it('can view his own job status', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                        createdByUserUuid: projectMemberAbility_mock_1.PROJECT_DEVELOPER.userUuid,
                    }))).toEqual(true);
                });
                it('can view job status from another user', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                        createdByUserUuid: 'admin-user-uuid-4567',
                    }))).toEqual(true);
                });
                it('can view job status from the project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                    }))).toEqual(true);
                });
                it('cannot view job status from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('AiAgent', () => {
                it('can manage AiAgent', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(true);
                });
                it('cannot manage AiAgent from another project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgent', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('AiAgentThread', () => {
                it('can manage only his own AiAgentThread', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_DEVELOPER.userUuid,
                    }))).toEqual(true);
                });
                it('cannot manage other users AiAgentThread', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot manage AiAgentThread from another project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('ScheduledDeliveries', () => {
                it('can create ScheduledDeliveries', () => {
                    expect(ability.can('create', (0, ability_1.subject)('ScheduledDeliveries', { projectUuid }))).toEqual(true);
                });
                it('can manage only his own ScheduledDeliveries', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_DEVELOPER.userUuid,
                    }))).toEqual(true);
                });
                it('cannot manage ScheduledDeliveries created by other users', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot manage ScheduledDeliveries from another project', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid: '5678',
                    }))).toEqual(false);
                });
            });
            describe('SourceCode', () => {
                it('can manage SourceCode on a non-protected branch', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('SourceCode', {
                        projectUuid,
                        isProtectedBranch: false,
                    }))).toEqual(true);
                });
                it('cannot manage SourceCode on a protected branch', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('SourceCode', {
                        projectUuid,
                        isProtectedBranch: true,
                    }))).toEqual(false);
                });
            });
        });
        describe('when user is a viewer', () => {
            beforeEach(() => {
                ability = defineAbilityForProjectMember(projectMemberAbility_mock_1.PROJECT_VIEWER);
            });
            it('can only view public & accessable dashboards', () => {
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(false);
            });
            it('can view and manage public & accessable saved charts', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(false);
            });
            it('can view and manage public & accessable space', () => {
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.VIEWER,
                        },
                    ],
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(true);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                    access: [
                        {
                            userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                            role: space_1.SpaceMemberRole.EDITOR,
                        },
                    ],
                }))).toEqual(false);
            });
            it('can view other public resources', () => {
                expect(ability.can('view', (0, ability_1.subject)('Project', { projectUuid }))).toEqual(true);
            });
            it('cannot view resources from another project', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Project', { projectUuid: '5678' }))).toEqual(false);
            });
            it('cannot manage resources', () => {
                expect(ability.can('manage', (0, ability_1.subject)('Project', { projectUuid }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Job', { projectUuid }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('SqlRunner', { projectUuid }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('SemanticViewer', { projectUuid }))).toEqual(false);
            });
            it('can download CSV', () => {
                expect(ability.can('manage', (0, ability_1.subject)('ExportCsv', { projectUuid }))).toEqual(true);
            });
            it('cannot change csv results', () => {
                expect(ability.can('manage', (0, ability_1.subject)('ChangeCsvResults', { projectUuid }))).toEqual(false);
            });
            it('cannot Explore', () => {
                expect(ability.can('manage', (0, ability_1.subject)('Explore', { projectUuid }))).toEqual(false);
            });
            it('cannot view underlying data', () => {
                expect(ability.can('view', (0, ability_1.subject)('UnderlyingData', { projectUuid }))).toEqual(false);
            });
            describe('JobStatus', () => {
                it('can view his own job status', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        createdByUserUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                    }))).toEqual(true);
                });
                it('cannot view job status from the project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', {
                        projectUuid,
                        createdByUserUuid: undefined,
                    }))).toEqual(false);
                });
                it('cannot view job status from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('JobStatus', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('AiAgent', () => {
                it('cannot view AiAgent', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(false);
                });
                it('cannot manage AiAgent', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(false);
                });
            });
            describe('AiAgentThread', () => {
                it('can view only his own AiAgentThread', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                    }))).toEqual(true);
                });
                it('cannot view other users AiAgentThread', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot manage his own AiAgentThread', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_VIEWER.userUuid,
                    }))).toEqual(false);
                });
                it('cannot create AiAgentThread', () => {
                    expect(ability.can('create', (0, ability_1.subject)('AiAgentThread', { projectUuid }))).toEqual(false);
                });
                it('cannot view AiAgentThread from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('ScheduledDeliveries', () => {
                it('cannot create ScheduledDeliveries', () => {
                    expect(ability.can('create', (0, ability_1.subject)('ScheduledDeliveries', { projectUuid }))).toEqual(false);
                });
                it('cannot manage ScheduledDeliveries', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', { projectUuid }))).toEqual(false);
                });
            });
        });
        describe('when user is a interactive viewer', () => {
            beforeEach(() => {
                ability = defineAbilityForProjectMember(projectMemberAbility_mock_1.PROJECT_INTERACTIVE_VIEWER);
            });
            it('can view public resources', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('Project', { projectUuid }))).toEqual(true);
                expect(ability.can('view', (0, ability_1.subject)('SemanticViewer', { projectUuid }))).toEqual(true);
            });
            it('can not view private resources', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                }))).toEqual(false);
            });
            it('cannot view resources from another project', () => {
                expect(ability.can('view', (0, ability_1.subject)('SavedChart', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Dashboard', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Space', {
                    projectUuid: '5678',
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('view', (0, ability_1.subject)('Project', { projectUuid: '5678' }))).toEqual(false);
            });
            it('cannot manage resources', () => {
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: true,
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('SavedChart', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Dashboard', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Space', {
                    projectUuid,
                    inheritsFromOrgOrProject: false,
                }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Project', { projectUuid }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('Job', { projectUuid }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('SqlRunner', { projectUuid }))).toEqual(false);
                expect(ability.can('manage', (0, ability_1.subject)('SemanticViewer', { projectUuid }))).toEqual(false);
            });
            it('can download CSV', () => {
                expect(ability.can('manage', (0, ability_1.subject)('ExportCsv', { projectUuid }))).toEqual(true);
            });
            it('can Explore', () => {
                expect(ability.can('manage', (0, ability_1.subject)('Explore', { projectUuid }))).toEqual(true);
            });
            it('can view underlying data', () => {
                expect(ability.can('view', (0, ability_1.subject)('UnderlyingData', { projectUuid }))).toEqual(true);
            });
            describe('AiAgent', () => {
                it('can view AiAgent', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(true);
                });
                it('cannot manage AiAgent', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgent', { projectUuid }))).toEqual(false);
                });
                it('cannot view AiAgent from another project', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgent', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('AiAgentThread', () => {
                it('can create AiAgentThread', () => {
                    expect(ability.can('create', (0, ability_1.subject)('AiAgentThread', { projectUuid }))).toEqual(true);
                });
                it('can view only his own AiAgentThread', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_INTERACTIVE_VIEWER.userUuid,
                    }))).toEqual(true);
                });
                it('cannot view other users AiAgentThread', () => {
                    expect(ability.can('view', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot manage his own AiAgentThread', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('AiAgentThread', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_INTERACTIVE_VIEWER.userUuid,
                    }))).toEqual(false);
                });
                it('cannot create AiAgentThread in another project', () => {
                    expect(ability.can('create', (0, ability_1.subject)('AiAgentThread', { projectUuid: '5678' }))).toEqual(false);
                });
            });
            describe('ScheduledDeliveries', () => {
                it('can create ScheduledDeliveries', () => {
                    expect(ability.can('create', (0, ability_1.subject)('ScheduledDeliveries', { projectUuid }))).toEqual(true);
                });
                it('can manage only his own ScheduledDeliveries', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid,
                        userUuid: projectMemberAbility_mock_1.PROJECT_INTERACTIVE_VIEWER.userUuid,
                    }))).toEqual(true);
                });
                it('cannot manage ScheduledDeliveries created by other users', () => {
                    expect(ability.can('manage', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid,
                        userUuid: 'another-user-uuid',
                    }))).toEqual(false);
                });
                it('cannot create ScheduledDeliveries in another project', () => {
                    expect(ability.can('create', (0, ability_1.subject)('ScheduledDeliveries', {
                        projectUuid: '5678',
                    }))).toEqual(false);
                });
            });
        });
    });
    [
        {
            membership: projectMemberAbility_mock_1.PROJECT_ADMIN,
            canCreatePreview: true,
            canDeleteTheirOwnPreview: true,
            canDeleteOthersPreview: true, // Admins can delete any project
        },
        {
            membership: projectMemberAbility_mock_1.PROJECT_DEVELOPER,
            canCreatePreview: true,
            canDeleteTheirOwnPreview: true,
            canDeleteOthersPreview: false,
        },
        {
            membership: projectMemberAbility_mock_1.PROJECT_EDITOR,
            canCreatePreview: false,
            canDeleteTheirOwnPreview: false,
            canDeleteOthersPreview: false,
        },
        {
            membership: projectMemberAbility_mock_1.PROJECT_INTERACTIVE_VIEWER,
            canCreatePreview: false,
            canDeleteTheirOwnPreview: false,
            canDeleteOthersPreview: false,
        },
        {
            membership: projectMemberAbility_mock_1.PROJECT_VIEWER,
            canCreatePreview: false,
            canDeleteTheirOwnPreview: false,
            canDeleteOthersPreview: false,
        },
    ].forEach(({ membership, canCreatePreview, canDeleteTheirOwnPreview, canDeleteOthersPreview, }) => {
        describe('test project preview permissions', () => {
            const ability = defineAbilityForProjectMember(membership);
            it('checks if user can create PREVIEW projects', () => {
                expect(ability.can('create', (0, ability_1.subject)('Project', {
                    upstreamProjectUuid: projectUuid,
                    type: projects_1.ProjectType.PREVIEW,
                }))).toEqual(canCreatePreview);
            });
            it('checks that users cannot create regular projects', () => {
                expect(ability.can('create', (0, ability_1.subject)('Project', {
                    upstreamProjectUuid: projectUuid,
                    type: projects_1.ProjectType.DEFAULT,
                }))).toEqual(false);
            });
            it('checks if user can delete their own PREVIEW projects', () => {
                expect(ability.can('delete', (0, ability_1.subject)('Project', {
                    projectUuid,
                    createdByUserUuid: membership.userUuid,
                    type: projects_1.ProjectType.PREVIEW,
                }))).toEqual(canDeleteTheirOwnPreview);
            });
            it('checks if user can delete other users PREVIEW projects', () => {
                expect(ability.can('delete', (0, ability_1.subject)('Project', {
                    projectUuid,
                    createdByUserUuid: '1234',
                    type: projects_1.ProjectType.PREVIEW,
                }))).toEqual(canDeleteOthersPreview);
            });
        });
    });
});
//# sourceMappingURL=projectMemberAbility.test.js.map