Fork me on GitHub

Licode's Blog 

Here we will keep you informed about last news, events, and other stuff related to Licode and WebRTC.

Configuration of roles in Licode

- Lynckia

In this post we will explain in detail how to configure our custom roles in our Licode’s service.

Erizo Controller now supports the definition of role as a set of permissions, and these permissions are already predefined in this component. A permission allows a user to perform an action on a resource. Below you can find a list of the current permissions:

These permissions are fixed in the source code, we can not create new ones without changing the code. But we can create roles from them. For example, if we aim to create e-learning applications we could create a role for the teacher, who should be able to publish, subscribe and even record the stream. On the other hand, the student could only subscribe to other streams. In this case our application would have both roles. In this case we should configure our Licode’s installation with the next line:

config.roles = {
  "teacher":["publish", "subscribe", "record"],

Important update: the new format to specify roles is:

config.roles = {
  "teacher": {"publish": true, "subscribe": true, "record": true},
  "student": {"subscribe": true}

As said above we can edit the roles in the configuration file that we can find at licode/licode_config.js once installed.