Role Management

LAST EDIT Apr 08 2021

Change a User Role

Copied!
1
2
3
4
5
const update = await serverClient.updateUser({ 
    id: 'tommaso', 
    name: 'Tommy Doe', 
    role: 'admin', 
});
1
2
3
4
5
client.update_user({ 
    "id" => "tommaso", 
    "name" => "Tommy Doe", 
    "role" => "admin", 
});
1
2
3
4
5
client.update_user({ 
    "id": "tommaso", 
    "name": "Tommy Doe", 
    "role": "admin", 
});
1
2
3
4
5
$response = $client->updateUser([ 
    'id' => 'tommaso', 
    'name' => 'Tommy Doe', 
    'role' => 'admin' 
]);
1
// at the moment we don't have a Java client for server side usage
1
2
3
4
5
6
7
8
9
user := User{ 
    ID: "tommaso", 
    Role: "admin", 
    ExtraData: map[string]interface{}{ 
        "name": "Tommy Doe", 
    } 
}; 
 
client.UpdateUser(&user);
1
// at the moment we don't have a Swift client for server side usage
1
2
3
4
5
6
7
8
var user = new User() 
{ 
    ID = "tommaso", 
    Role = Role.Admin, 
}; 
bob.SetData("name", "Tommy Doe"); 
 
await client.Users.Update(user);

Add Moderators to a Channel

Copied!
1
2
const channel = serverClient.channel("livestream", "fortnite"); 
await channel.addModerators(["thierry", "tommaso"]));
1
2
channel = client.channel("livestream", "fortnite"); 
channel.add_moderators(["thierry", "tommaso"]);
1
2
channel = client.channel("livestream", "fortnite"); 
channel.add_moderators(["thierry", "tommaso"]);
1
2
3
4
$channel = $client->Channel("livestream", "fortnite"); 
$channel->create('thierry'); 
 
$response = $channel->addModerators(['thierry', 'jenny']);
1
// at the moment we don't have a Java client for server side usage
1
2
channel = client.Channel("livestream", "fortnite"); 
channel.AddModerators("thierry", "tommaso");
1
// at the moment we don't have a Swift client for server side usage
1
2
var chan = client.Channel("livestream", "fortnite"); 
await chan.AddModerators(new string[] { "thierry", "tommaso" });

Remove Moderators From a Channel

Copied!
1
await channel.demoteModerators(["thierry"]));
1
channel.demote_moderators(["thierry"]);
1
channel.demote_moderators(["thierry"]);
1
$channel->demoteModerators(['thierry']);
1
// at the moment we don't have a Java client for server side usage
1
channel.DemoteModerators("thierry");
1
// at the moment we don't have a Swift client for server side usage
1
await chan.DemoteModerators(new string[] { "thierry", "tommaso" });