Skip to content

Commit a6f0ce9

Browse files
committed
fix: departments collaborators permisison
1 parent 0dafdfa commit a6f0ce9

File tree

5 files changed

+1
-6
lines changed

5 files changed

+1
-6
lines changed

apps/nestjs-backend/src/features/base/base.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export class BaseService {
6060
where: {
6161
resourceId: { in: [baseId, base.spaceId] },
6262
principalId: { in: [userId, ...(departmentIds || [])] },
63-
principalType: PrincipalType.User,
6463
},
6564
});
6665

apps/nestjs-backend/src/features/collaborator/collaborator.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,6 @@ export class CollaboratorService {
690690
const coll = await this.prismaService.txClient().collaborator.findMany({
691691
where: {
692692
principalId: { in: [userId, ...(departmentIds || [])] },
693-
principalType: PrincipalType.User,
694693
resourceType: CollaboratorType.Base,
695694
},
696695
select: {

apps/nestjs-backend/src/features/space/space.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export class SpaceService {
8181
},
8282
where: {
8383
principalId: { in: [userId, ...(departmentIds || [])] },
84-
principalType: PrincipalType.User,
8584
resourceType: CollaboratorType.Space,
8685
},
8786
});

apps/nestjs-backend/src/features/table/table-permission.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export class TablePermissionService {
4444
where: {
4545
principalId: { in: [userId, ...(departmentIds || [])] },
4646
resourceId: { in: [baseId, base.spaceId] },
47-
principalType: PrincipalType.User,
4847
},
4948
});
5049
if (collaborators.length === 0) {

apps/nestjs-backend/src/features/trash/trash.service.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {
1616
ITrashRo,
1717
ITrashVo,
1818
} from '@teable/openapi';
19-
import { CollaboratorType, PrincipalType, ResourceType } from '@teable/openapi';
19+
import { CollaboratorType, ResourceType } from '@teable/openapi';
2020
import { keyBy } from 'lodash';
2121
import { ClsService } from 'nestjs-cls';
2222
import type { ICreateFieldsOperation } from '../../cache/types';
@@ -50,7 +50,6 @@ export class TrashService {
5050
const collaborators = await this.prismaService.txClient().collaborator.findMany({
5151
where: {
5252
principalId: { in: [userId, ...(departmentIds || [])] },
53-
principalType: PrincipalType.User,
5453
roleName: { in: [Role.Owner, Role.Creator] },
5554
},
5655
select: {

0 commit comments

Comments
 (0)