Office: Forbid anonymous invites & join requests (#10065)

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>
This commit is contained in:
Anton Alexeyev
2025-10-11 00:45:24 +05:00
committed by GitHub
parent fcb095926f
commit a1ffab395b
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -13,7 +13,7 @@
// limitations under the License.
//
import { type Ref } from '@hcengineering/core'
import { AccountRole, getCurrentAccount, type Ref } from '@hcengineering/core'
import { getCurrentEmployee, type Person } from '@hcengineering/contact'
import { type PopupResult, showPopup } from '@hcengineering/ui'
import { type UnsubscribeCallback } from '@hcengineering/hulypulse-client'
@@ -68,6 +68,7 @@ export async function unsubscribeInviteResponses (): Promise<void> {
}
export function sendInvites (persons: Array<Ref<Person>>): void {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
closeInvitesPopup()
requestPersons = persons
const myParticipation = get(myInfo)
@@ -86,6 +87,7 @@ export function closeInvitesPopup (): void {
}
export async function updateInvites (persons: Array<Ref<Person>>, meetingId: string): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
const client = await createPulseClient()
const currentPerson = getCurrentEmployee()
@@ -143,6 +145,7 @@ let activeRequestKey: string | undefined
let activeRequestsMap: Map<string, InviteRequest | undefined>
export async function subscribeInviteRequests (): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
const client = await createPulseClient()
if (client === undefined) return
+4 -1
View File
@@ -13,7 +13,7 @@
// limitations under the License.
//
import { type Ref } from '@hcengineering/core'
import { AccountRole, getCurrentAccount, type Ref } from '@hcengineering/core'
import { getCurrentEmployee, type Person } from '@hcengineering/contact'
import { type PopupResult, showPopup } from '@hcengineering/ui'
import { type UnsubscribeCallback } from '@hcengineering/hulypulse-client'
@@ -65,6 +65,7 @@ export async function unsubscribeJoinResponses (): Promise<void> {
}
export function sendJoinRequest (meetingId: string): void {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
closeJoinRequestPopup()
requestMeetingId = meetingId
requestPopup = showPopup(JoinRequestPopup, { meetingId }, undefined, undefined, undefined, {
@@ -80,6 +81,7 @@ export function closeJoinRequestPopup (): void {
}
export async function updateJoinRequest (): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
const client = await createPulseClient()
const currentPerson = getCurrentEmployee()
@@ -135,6 +137,7 @@ let activeRequestKey: string | undefined
let activeRequestsMap: Map<string, JoinRequest | undefined> | undefined
export async function subscribeJoinRequests (meetingId: string | undefined): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
if (meetingId === undefined) return
const client = await createPulseClient()