fix checking for guest in meetings (#8750)

* fix checking for guest in meetings

Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>

* don't check role in person, use employee mixin

Co-authored-by: Andrey Sobolev <haiodo@users.noreply.github.com>
Signed-off-by: Chunosov <N.Chunosov@yandex.ru>
Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>

* fix formatting

Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>

---------

Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>
Signed-off-by: Chunosov <N.Chunosov@yandex.ru>
Co-authored-by: Andrey Sobolev <haiodo@users.noreply.github.com>
This commit is contained in:
Chunosov 2025-04-29 13:29:36 +07:00 committed by GitHub
parent d3a40bb48e
commit 89d2d6872a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View File

@ -17,7 +17,13 @@
<script lang="ts">
import { Schedule } from '@hcengineering/calendar'
import { getCurrentEmployee } from '@hcengineering/contact'
import presentation, { createQuery, getClient, getCurrentWorkspaceUrl, MessageBox } from '@hcengineering/presentation'
import presentation, {
copyTextToClipboard,
createQuery,
getClient,
getCurrentWorkspaceUrl,
MessageBox
} from '@hcengineering/presentation'
import { Action, ButtonIcon, IconAdd, IconDelete, IconLink, NavItem, showPopup } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { TreeElement } from '@hcengineering/view-resources'
@ -91,7 +97,7 @@
okLabel: presentation.string.CopyLink,
canSubmit: false,
action: async () => {
await navigator.clipboard.writeText(link)
await copyTextToClipboard(link)
}
},
undefined

View File

@ -3,7 +3,7 @@ import { connectMeeting, disconnectMeeting } from '@hcengineering/ai-bot-resourc
import { Analytics } from '@hcengineering/analytics'
import calendar, { type Event, type Schedule, getAllEvents } from '@hcengineering/calendar'
import chunter from '@hcengineering/chunter'
import contact, { type Employee, getCurrentEmployee, getName, type Person } from '@hcengineering/contact'
import contact, { getCurrentEmployee, getName, type Person } from '@hcengineering/contact'
import { personByIdStore } from '@hcengineering/contact-resources'
import core, {
AccountRole,
@ -956,7 +956,7 @@ export async function tryConnect (
await client.update(invite, { status: invite.room === room._id ? RequestStatus.Approved : RequestStatus.Rejected })
}
const isGuest = (currentPerson as Employee).role === AccountRole.Guest
const isGuest = client.getHierarchy().as(currentPerson, contact.mixin.Employee).role === AccountRole.Guest
if ((room.access === RoomAccess.Knock || isGuest) && (!isOffice(room) || room.person !== currentPerson._id)) {
const _id = await client.createDoc(love.class.JoinRequest, core.space.Workspace, {
person: currentPerson._id,