mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-15 12:01:33 +00:00
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:
parent
d3a40bb48e
commit
89d2d6872a
@ -17,7 +17,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Schedule } from '@hcengineering/calendar'
|
import { Schedule } from '@hcengineering/calendar'
|
||||||
import { getCurrentEmployee } from '@hcengineering/contact'
|
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 { Action, ButtonIcon, IconAdd, IconDelete, IconLink, NavItem, showPopup } from '@hcengineering/ui'
|
||||||
import view from '@hcengineering/view'
|
import view from '@hcengineering/view'
|
||||||
import { TreeElement } from '@hcengineering/view-resources'
|
import { TreeElement } from '@hcengineering/view-resources'
|
||||||
@ -91,7 +97,7 @@
|
|||||||
okLabel: presentation.string.CopyLink,
|
okLabel: presentation.string.CopyLink,
|
||||||
canSubmit: false,
|
canSubmit: false,
|
||||||
action: async () => {
|
action: async () => {
|
||||||
await navigator.clipboard.writeText(link)
|
await copyTextToClipboard(link)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
undefined
|
undefined
|
||||||
|
@ -3,7 +3,7 @@ import { connectMeeting, disconnectMeeting } from '@hcengineering/ai-bot-resourc
|
|||||||
import { Analytics } from '@hcengineering/analytics'
|
import { Analytics } from '@hcengineering/analytics'
|
||||||
import calendar, { type Event, type Schedule, getAllEvents } from '@hcengineering/calendar'
|
import calendar, { type Event, type Schedule, getAllEvents } from '@hcengineering/calendar'
|
||||||
import chunter from '@hcengineering/chunter'
|
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 { personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import core, {
|
import core, {
|
||||||
AccountRole,
|
AccountRole,
|
||||||
@ -956,7 +956,7 @@ export async function tryConnect (
|
|||||||
await client.update(invite, { status: invite.room === room._id ? RequestStatus.Approved : RequestStatus.Rejected })
|
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)) {
|
if ((room.access === RoomAccess.Knock || isGuest) && (!isOffice(room) || room.person !== currentPerson._id)) {
|
||||||
const _id = await client.createDoc(love.class.JoinRequest, core.space.Workspace, {
|
const _id = await client.createDoc(love.class.JoinRequest, core.space.Workspace, {
|
||||||
person: currentPerson._id,
|
person: currentPerson._id,
|
||||||
|
Loading…
Reference in New Issue
Block a user