Skip to content

Commit 4c7a337

Browse files
committed
chore: fix missed security check
1 parent 3d559f1 commit 4c7a337

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

meteor/server/api/userActions.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ import { NrcsIngestCacheType } from '@sofie-automation/corelib/dist/dataModel/Nr
4545
import { verifyHashedToken } from './singleUseTokens'
4646
import { QuickLoopMarker } from '@sofie-automation/corelib/dist/dataModel/RundownPlaylist'
4747
import { runIngestOperation } from './ingest/lib'
48-
import { RundownPlaylistContentWriteAccess } from '../security/rundownPlaylist'
4948
import { IngestJobs } from '@sofie-automation/corelib/dist/worker/ingest'
5049
import { UserPermissions } from '@sofie-automation/meteor-lib/dist/userPermissions'
5150
import { assertConnectionHasOneOfPermissions } from '../security/auth'
51+
import { checkAccessToRundown } from '../security/check'
5252

5353
const PERMISSIONS_FOR_PLAYOUT_USERACTION: Array<keyof UserPermissions> = ['studio']
5454
const 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

Comments
 (0)