platform/plugins/guest/src/utils.ts
Alexey Zinoviev c69252404a
uberf-6255: minor guest and pdf viewer adjustments (#5164)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
2024-04-03 20:41:31 +07:00

29 lines
621 B
TypeScript

//
// Copyright © 2024 Hardcore Engineering Inc.
//
import { Doc, TxOperations } from '@hcengineering/core'
import { type Location } from '@hcengineering/ui'
import guest from './index'
export async function createPublicLink (
client: TxOperations,
object: Doc,
location: Location,
revokable: boolean = true
): Promise<void> {
await client.createDoc(guest.class.PublicLink, guest.space.Links, {
attachedTo: object._id,
location,
revokable,
restrictions: {
readonly: true,
disableNavigation: true,
disableActions: true,
disableComments: true
},
url: ''
})
}