Skip to content

Commit 5e144a1

Browse files
adrastaeaCopilot
andcommitted
Add check for team membership before pulling log entries in QSSService
Co-authored-by: Copilot <copilot@github.com>
1 parent 09390fe commit 5e144a1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/backend/src/nest/qss/qss.service.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,17 @@ export class QSSService extends EventEmitter implements OnModuleDestroy, OnModul
982982
let nextStartSeq = await this.localDbService.getLastSyncSeq(teamId)
983983
const sigchain = this.sigChainService.getChain({ teamId })
984984
const userId = sigchain.context.user.userId
985+
if (!sigchain.roles.amIMemberOfRole(RoleName.MEMBER)) {
986+
this.logger.warn(`User is not a member of team ${teamId}, skipping log entry pull until full join`)
987+
return {
988+
ts: DateTime.utc().toMillis(),
989+
status: CommunityOperationStatus.UNAUTHORIZED,
990+
payload: {
991+
hasNextPage: false,
992+
entries: [],
993+
},
994+
}
995+
}
985996

986997
let hasNextPage = true
987998
let page = 0

0 commit comments

Comments
 (0)