1- import {
2- PartInstanceId ,
3- RundownId ,
4- RundownPlaylistActivationId ,
5- SegmentId ,
6- } from '@sofie-automation/corelib/dist/dataModel/Ids'
1+ import { PartInstanceId , RundownPlaylistActivationId , SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'
72import { check } from 'meteor/check'
83import {
94 CustomPublishCollection ,
@@ -26,7 +21,6 @@ import { RundownsObserver } from '../lib/rundownsObserver'
2621import { RundownContentObserver } from './rundownContentObserver'
2722import { protectString } from '@sofie-automation/corelib/dist/protectedString'
2823import { Match } from '../../lib/check'
29- import { RundownReadAccess } from '../../security/rundown'
3024import { DBPartInstance } from '@sofie-automation/corelib/dist/dataModel/PartInstance'
3125import {
3226 extractRanks ,
@@ -37,7 +31,6 @@ import {
3731
3832interface UIPartInstancesArgs {
3933 readonly playlistActivationId : RundownPlaylistActivationId
40- readonly rundownIds : RundownId [ ]
4134}
4235
4336export interface UIPartInstancesState {
@@ -205,32 +198,26 @@ export async function manipulateUIPartInstancesPublicationData(
205198meteorCustomPublish (
206199 MeteorPubSub . uiPartInstances ,
207200 CustomCollectionName . UIPartInstances ,
208- async function ( pub , rundownIds : RundownId [ ] , playlistActivationId : RundownPlaylistActivationId | null ) {
209- check ( rundownIds , [ String ] )
201+ async function ( pub , playlistActivationId : RundownPlaylistActivationId | null ) {
210202 check ( playlistActivationId , Match . Maybe ( String ) )
211203
212204 const credentials = await resolveCredentials ( { userId : this . userId , token : undefined } )
213205
214- if (
215- playlistActivationId &&
216- ( ! credentials ||
217- NoSecurityReadAccess . any ( ) ||
218- ( await RundownReadAccess . rundownContent ( { $in : rundownIds } , credentials ) ) )
219- ) {
206+ if ( playlistActivationId && ( ! credentials || NoSecurityReadAccess . any ( ) ) ) {
220207 await setUpCollectionOptimizedObserver <
221208 Omit < DBPartInstance , PartInstanceOmitedFields > ,
222209 UIPartInstancesArgs ,
223210 UIPartInstancesState ,
224211 UIPartInstancesUpdateProps
225212 > (
226- `pub_${ MeteorPubSub . uiPartInstances } _${ rundownIds . join ( ',' ) } _ ${ playlistActivationId } ` ,
227- { rundownIds , playlistActivationId } ,
213+ `pub_${ MeteorPubSub . uiPartInstances } _${ playlistActivationId } ` ,
214+ { playlistActivationId } ,
228215 setupUIPartInstancesPublicationObservers ,
229216 manipulateUIPartInstancesPublicationData ,
230217 pub
231218 )
232219 } else {
233- logger . warn ( `Pub.uiPartInstances: Not allowed: [ ${ rundownIds . join ( ',' ) } ] "${ playlistActivationId } "` )
220+ logger . warn ( `Pub.uiPartInstances: Not allowed:"${ playlistActivationId } "` )
234221 }
235222 }
236223)
0 commit comments