Role Management

Last Edit: Mar 03 2020

Change a User Role


const update = await serverClient.updateUser({
    id: 'tommaso',
    name: 'Tommy Doe',
    role: 'admin',
});
                    

client.update_user({
    "id" => "tommaso",
    "name" => "Tommy Doe",
    "role" => "admin",
});
                    

client.update_user({
    "id": "tommaso",
    "name": "Tommy Doe",
    "role": "admin",
});
                    

$response = $client->updateUser([
    'id' => 'tommaso',
    'name' => 'Tommy Doe',
    'role' => 'admin'
]);
                    

// at the moment we don't have a Java client for server side usage
                    

user := User{
    ID: "tommaso",
    Role: "admin",
    ExtraData: map[string]interface{}{
        "name": "Tommy Doe",
    }
};

client.UpdateUser(&user);
                    

// at the moment we don't have a Swift client for server side usage
                    

var user = new User()
{
    ID = "tommaso",
    Role = Role.Admin,
};
bob.SetData("name", "Tommy Doe");

await client.Users.Update(user);
                    

Add Moderators to a Channel


const channel = serverClient.channel("livestream", "fortnite");
await channel.addModerators(["thierry", "tommaso"]));
                    

channel = client.channel("livestream", "fortnite");
channel.add_moderators(["thierry", "tommaso"]);
                    

channel = client.channel("livestream", "fortnite");
channel.add_moderators(["thierry", "tommaso"]);
                    

$channel = $client->Channel("livestream", "fortnite");
$channel->create('thierry');

$response = $channel->addModerators(['thierry', 'jenny']);
                    

// at the moment we don't have a Java client for server side usage
                    

channel = client.Channel("livestream", "fortnite");
channel.AddModerators("thierry", "tommaso");
                    

// at the moment we don't have a Swift client for server side usage
                    

var chan = client.Channel("livestream", "fortnite");
await chan.AddModerators(new string[] { "thierry", "tommaso" });
                    

Remove Moderators From a Channel


await channel.demoteModerators(["thierry"]));
                    

channel.demote_moderators(["thierry"]);
                    

channel.demote_moderators(["thierry"]);
                    

$channel->demoteModerators(['thierry']);
                    

// at the moment we don't have a Java client for server side usage
                    

channel.DemoteModerators("thierry");
                    

// at the moment we don't have a Swift client for server side usage
                    

await chan.DemoteModerators(new string[] { "thierry", "tommaso" });