@@ -4,19 +4,11 @@ import { MongoQueryKey } from '@sofie-automation/corelib/dist/mongo'
44import { logNotAllowed } from './lib/lib'
55import { ExternalMessageQueueObj } from '@sofie-automation/corelib/dist/dataModel/ExternalMessageQueue'
66import { Credentials , ResolvedCredentials , resolveCredentials } from './lib/credentials'
7- import { DBRundownPlaylist } from '@sofie-automation/corelib/dist/dataModel/RundownPlaylist'
87import { Settings } from '../Settings'
98import { triggerWriteAccess } from './lib/securityVerify'
109import { isProtectedString } from '../lib/tempLib'
1110import { fetchStudioLight } from '../optimizations'
12- import {
13- ExternalMessageQueueObjId ,
14- OrganizationId ,
15- RundownPlaylistId ,
16- StudioId ,
17- UserId ,
18- } from '@sofie-automation/corelib/dist/dataModel/Ids'
19- import { ExternalMessageQueue , RundownPlaylists } from '../collections'
11+ import { OrganizationId , StudioId , UserId } from '@sofie-automation/corelib/dist/dataModel/Ids'
2012import { StudioLight } from '@sofie-automation/corelib/dist/dataModel/Studio'
2113
2214export namespace StudioReadAccess {
@@ -61,25 +53,6 @@ export interface ExternalMessageContentAccess extends StudioContentAccess {
6153export namespace StudioContentWriteAccess {
6254 // These functions throws if access is not allowed.
6355
64- export async function rundownPlaylist (
65- cred0 : Credentials ,
66- existingPlaylist : DBRundownPlaylist | RundownPlaylistId
67- ) : Promise < StudioContentAccess & { playlist : DBRundownPlaylist } > {
68- triggerWriteAccess ( )
69- if ( existingPlaylist && isProtectedString ( existingPlaylist ) ) {
70- const playlistId = existingPlaylist
71- const m = await RundownPlaylists . findOneAsync ( playlistId )
72- if ( ! m ) throw new Meteor . Error ( 404 , `RundownPlaylist "${ playlistId } " not found!` )
73- existingPlaylist = m
74- }
75- return { ...( await anyContent ( cred0 , existingPlaylist . studioId ) ) , playlist : existingPlaylist }
76- }
77-
78- /** Check for permission to select active routesets in the studio */
79- export async function routeSet ( cred0 : Credentials , studioId : StudioId ) : Promise < StudioContentAccess > {
80- return anyContent ( cred0 , studioId )
81- }
82-
8356 /** Check for permission to modify a bucket or its contents belonging to the studio */
8457 export async function bucket ( cred0 : Credentials , studioId : StudioId ) : Promise < StudioContentAccess > {
8558 return anyContent ( cred0 , studioId )
@@ -90,21 +63,6 @@ export namespace StudioContentWriteAccess {
9063 return anyContent ( cred0 , studioId )
9164 }
9265
93- /** Check for permission to modify an ExternalMessageQueueObj */
94- export async function externalMessage (
95- cred0 : Credentials ,
96- existingMessage : ExternalMessageQueueObj | ExternalMessageQueueObjId
97- ) : Promise < ExternalMessageContentAccess > {
98- triggerWriteAccess ( )
99- if ( existingMessage && isProtectedString ( existingMessage ) ) {
100- const messageId = existingMessage
101- const m = await ExternalMessageQueue . findOneAsync ( messageId )
102- if ( ! m ) throw new Meteor . Error ( 404 , `ExternalMessage "${ messageId } " not found!` )
103- existingMessage = m
104- }
105- return { ...( await anyContent ( cred0 , existingMessage . studioId ) ) , message : existingMessage }
106- }
107-
10866 /**
10967 * We don't have user levels, so we can use a simple check for all cases
11068 * Return credentials if writing is allowed, throw otherwise
0 commit comments