mirror of
https://github.com/dfpc-coe/CloudTAK.git
synced 2025-12-22 05:37:16 +00:00
Allow Posting & Patching VideoLease.share
This commit is contained in:
@@ -443,6 +443,7 @@ export default class VideoServiceControl {
|
||||
recording: boolean;
|
||||
publish: boolean;
|
||||
secure: boolean;
|
||||
share: boolean;
|
||||
channel?: string | null;
|
||||
proxy?: string | null;
|
||||
}): Promise<Static<typeof VideoLeaseResponse>> {
|
||||
@@ -468,6 +469,7 @@ export default class VideoServiceControl {
|
||||
username: opts.username,
|
||||
connection: opts.connection,
|
||||
layer: opts.layer,
|
||||
share: opts.share,
|
||||
channel: opts.channel,
|
||||
proxy: opts.proxy
|
||||
});
|
||||
@@ -574,7 +576,7 @@ export default class VideoServiceControl {
|
||||
const groups = (await api.Group.list({ useCache: true }))
|
||||
.data.map((group) => group.name);
|
||||
|
||||
if (lease.username !== opts.username && (!lease.channel || !groups.includes(lease.channel))) {
|
||||
if (lease.username !== opts.username && (!lease.share || !lease.channel || !groups.includes(lease.channel))) {
|
||||
throw new Err(400, null, 'You can only access a lease you created or that is assigned to a channel you are in');
|
||||
}
|
||||
|
||||
@@ -590,6 +592,7 @@ export default class VideoServiceControl {
|
||||
body: {
|
||||
name?: string,
|
||||
channel?: string | null,
|
||||
share?: boolean,
|
||||
secure?: boolean,
|
||||
secure_rotate?: boolean
|
||||
expiration?: string | null,
|
||||
|
||||
@@ -398,6 +398,10 @@ export default async function router(schema: Schema, config: Config) {
|
||||
default: false,
|
||||
description: 'Publish stream URL to TAK Server Video Manager'
|
||||
}),
|
||||
share: Type.Boolean({
|
||||
default: false,
|
||||
description: 'Allow other users to manage lease if they are also members of the channel'
|
||||
}),
|
||||
secure: Type.Boolean({
|
||||
default: false,
|
||||
description: 'Increase stream security by enforcing a seperate read and write username/password'
|
||||
@@ -460,16 +464,18 @@ export default async function router(schema: Schema, config: Config) {
|
||||
source_model: Type.Optional(Type.String()),
|
||||
channel: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
||||
secure: Type.Optional(Type.Boolean()),
|
||||
recording: Type.Boolean({
|
||||
recording: Type.Optional(Type.Boolean({
|
||||
description: 'Record streams to disk'
|
||||
}),
|
||||
publish: Type.Boolean({
|
||||
})),
|
||||
publish: Type.Optional(Type.Boolean({
|
||||
description: 'Publish stream URL to TAK Server Video Manager'
|
||||
}),
|
||||
permanent: Type.Boolean({
|
||||
default: false,
|
||||
})),
|
||||
share: Type.Optional(Type.Boolean({
|
||||
description: 'Allow other users to manage lease if they are also members of the channel'
|
||||
})),
|
||||
permanent: Type.Optional(Type.Boolean({
|
||||
description: 'System Admins can create non-expiring leases'
|
||||
}),
|
||||
})),
|
||||
proxy: Type.Optional(Type.String())
|
||||
}),
|
||||
res: VideoLeaseResponse
|
||||
@@ -486,6 +492,7 @@ export default async function router(schema: Schema, config: Config) {
|
||||
const lease = await videoControl.commit(req.params.lease, {
|
||||
name: req.body.name,
|
||||
channel: req.body.channel ? req.body.channel : null,
|
||||
share: req.body.share,
|
||||
secure: req.body.secure,
|
||||
recording: req.body.recording,
|
||||
publish: req.body.publish,
|
||||
|
||||
Reference in New Issue
Block a user