Skip to content

Commit 0f171ea

Browse files
committed
Only allow setting thisApp to your own apps
1 parent 3981555 commit 0f171ea

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Sources/DataTransferObjects/Query/CustomQuery+CompileDown.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ extension CustomQuery {
248248

249249
case .thisApp:
250250
guard let appID = query.appID else { throw QueryGenerationError.keyMissing(reason: "Missing key 'appID'") }
251+
guard isSuperOrg || (organizationAppIDs ?? []).contains(appID) else { throw QueryGenerationError.notAllowed(reason: "AppID not in organization") }
251252
query.filter = try query.filter && appIDFilter(for: [appID]) && testModeFilter(for: query)
252253
return query
253254

0 commit comments

Comments
 (0)