@@ -45,10 +45,10 @@ import { NrcsIngestCacheType } from '@sofie-automation/corelib/dist/dataModel/Nr
4545import { verifyHashedToken } from './singleUseTokens'
4646import { QuickLoopMarker } from '@sofie-automation/corelib/dist/dataModel/RundownPlaylist'
4747import { runIngestOperation } from './ingest/lib'
48- import { RundownPlaylistContentWriteAccess } from '../security/rundownPlaylist'
4948import { IngestJobs } from '@sofie-automation/corelib/dist/worker/ingest'
5049import { UserPermissions } from '@sofie-automation/meteor-lib/dist/userPermissions'
5150import { assertConnectionHasOneOfPermissions } from '../security/auth'
51+ import { checkAccessToRundown } from '../security/check'
5252
5353const PERMISSIONS_FOR_PLAYOUT_USERACTION : Array < keyof UserPermissions > = [ 'studio' ]
5454const PERMISSIONS_FOR_BUCKET_MODIFICATION : Array < keyof UserPermissions > = [ 'studio' ]
@@ -1315,11 +1315,10 @@ class ServerUserActionAPI
13151315 'executeUserChangeOperation' ,
13161316 { operationTarget, operation } ,
13171317 async ( ) => {
1318- const access = await RundownPlaylistContentWriteAccess . rundown ( this , rundownId )
1319- if ( ! access . rundown ) throw new Error ( `Rundown "${ rundownId } " not found` )
1318+ const rundown = await checkAccessToRundown ( this . connection , rundownId )
13201319
1321- await runIngestOperation ( access . rundown . studioId , IngestJobs . UserExecuteChangeOperation , {
1322- rundownExternalId : access . rundown . externalId ,
1320+ await runIngestOperation ( rundown . studioId , IngestJobs . UserExecuteChangeOperation , {
1321+ rundownExternalId : rundown . externalId ,
13231322 operationTarget,
13241323 operation,
13251324 } )
0 commit comments