Permissions

Introduction

This page shows how you can create or update roles for a call type.

Stream has a role-based permission system. Each user has an application-level role, and also channel (chat product) and call (video product) level roles. Every role (be it application or call/channel level) contains a list of capabilities. A capability is an action (for example, create a call). The list of capabilities assigned to a role defines what a user is allowed to do. Call roles are defined on the call type level.

Configuring roles

When you create a call type, you can specify your role configurations. A role configuration consists of a role name and the list of capabilities that are enabled for that role.

When you create a call type, it comes with a default set of configurations. You can override or extend that.

The following example overrides the capabilities of the built-in admin role and defines the customrole.

Please note that for the below code to work, you need to create the customrole beforehand. You can do that in your Stream Dashboard.

client.video.createCallType({
  name: '<call type name>',
  grants: {
    admin: [
      VideoOwnCapability.SEND_AUDIO,
      VideoOwnCapability.SEND_VIDEO,
      VideoOwnCapability.MUTE_USERS,
    ],
    ['customrole']: [
      VideoOwnCapability.SEND_AUDIO,
      VideoOwnCapability.SEND_VIDEO,
    ],
  },
});

// or edit a built-in call type
client.video.updateCallType({
  name: 'default',
  grants: {
    /* ... */
  },
});

Built-in roles

There are 5 pre-defined call roles, these are:

  • user
  • moderator
  • host
  • admin
  • call-member

You can access the default roles and their capabilities in your Stream Dashboard.

Capabilities

The list of call capabilities that you can include in your role configurations:

  • join-call
  • read-call
  • create-call
  • join-ended-call
  • join-backstage
  • update-call
  • update-call-settings
  • screenshare
  • send-video
  • send-audio
  • start-record-call
  • stop-record-call
  • start-broadcast-call
  • stop-broadcast-call
  • end-call
  • mute-users
  • update-call-permissions
  • block-users
  • create-reaction
  • pin-for-everyone
  • remove-call-member
  • start-transcription-call
  • stop-transcription-call

© Getstream.io, Inc. All Rights Reserved.