Admin permissions
The workspace admin's settings are applied to the default UI automatically - denied features stay visible but disabled.
Overview
After login the package loads GET /settings/effective- the workspace admin's settings - and applies them to the default UI. A denied feature stays visible but disabled, with a tooltip such as “This feature is disabled by your administrator.”
What each setting controls
Gating your own components
Default components need no work. If you replace a slot, apply the same gate:
import { useAdminFeatureGate, AdminPermissionTooltip } from "@realtimexsco/live-chat"; function MyVideoCallButton({ onVideoCall, className }) { const gate = useAdminFeatureGate("videoCall"); return ( <AdminPermissionTooltip disabled={!gate.enabled} message={gate.disabledReason}> <button type="button" className={className} disabled={!gate.enabled} onClick={onVideoCall}> Video </button> </AdminPermissionTooltip> );}Gate keys: audioCall, videoCall, pushNotification, blockUsers, attachments, groupCreation, threads, drafts, canvas. For recording and whiteboard use useEffectiveSettingsOptional().getCallRecordingGate() / getWhiteboardGate(). Call useEffectiveSettingsOptional().refresh() to re-load after an admin change.
Also exported: fetchEffectiveSettings, DEFAULT_EFFECTIVE_SETTINGS and the EffectiveSettings type.