usePermissions
usePermissions(sessionId?: string): Object
usePermissions is a convenience hook to access the local participant's permissions.
Params
| Parameter | Optional | Type | Description |
|---|---|---|---|
sessionId | ✓ | string | A unique identifier for the participant |
Return type
Returns an object with the following properties:
| Name | Type | Description |
|---|---|---|
canSendAudio | boolean | true in case the local participant's permissions.canSend is true, or includes 'audio' |
canSendVideo | boolean | true in case the local participant's permissions.canSend is true, or includes 'video' |
canSendCustomAudio | boolean | true in case the local participant's permissions.canSend is true, or includes 'customAudio' |
canSendCustomVideo | boolean | true in case the local participant's permissions.canSend is true, or includes 'customVideo' |
canSendScreenAudio | boolean | true in case the local participant's permissions.canSend is true, or includes 'screenAudio' |
canSendScreenVideo | boolean | true in case the local participant's permissions.canSend is true, or includes 'screenVideo' |
hasPresence | boolean | true in case the local participant's permissions.hasPresence is true |
canAdminParticipants | boolean | true in case the local participant's permissions.canAdmin is true, or includes 'participants' |
canAdminStreaming | boolean | true in case the local participant's permissions.canAdmin is true, or includes 'streaming' |
canAdminTranscription | boolean | true in case the local participant's permissions.canAdmin is true, or includes 'transcription' |
permissions | Object | The local participant's permissions object, as returned from participants() |