Get Member Roles

21 May 2016

  • Release 9.78 - added optional parameter target.

21 December 2014

  • Release 7.34 - added.
getmemberroles (Commands)
TypeCorrade progressive command
Commandgetmemberroles
DescriptionThe getmemberroles command returns a CSV list of role names that a group member belongs to.
Permissionsgroup
Parametersgroup, password, firstname, lastname (or agent by agent UUID)
Last ChangesRelease 9.78 - added optional parameter target.

The getmemberroles command returns a CSV list of role names that a group member belongs to.

Command Required Parameters Required Corrade Permissions Example
getmemberroles group, password, firstname, lastname (or agent by agent UUID) group
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            // returns the roles that the
            // avatar named "Johnny Bravo"
            // belongs to for the given group
            "command", "getmemberroles",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            "firstname", "Johnny",
            "lastname", "Bravo",
            "callback", wasURLEscape(URL)
        ]
    )
);
Optional Parameter Possible Value Description
target A group name or UUID. The group to act upon. If this parameter is omitted, then the command acts upon the configured group passed to the group parameter.

Tutorial

The Linden Lab / Second Life grid protocol states that everyone inside a group is in the Everyone role regardless of what other roles they may be in. Similarly, you can only remove someone from the Everyone role by ejecting them from the group.

It would be superfluous for Corrade to tell you that someone is in the Everyone role - because if they are not, then that person is not inside the group in the first place.

The following is a short pseudocode to determine:

given an issued getmemberroles command.

if(success == False) {
     if(status == 19862) {
        // agent is not in group
        return;
    }
    // some other error occurred with status not 19862
    return;
}

if(success == True) {
    // agent is in group
    if(data is empty or undefined) {
        // agent is only in Everyone role
        return;
    }
    // agent is in the Everyone role and other roles
    return;
}

Note that the correct way to branch on Corrade error messages is to test the status key for the numeric value because the numeric values are and will be unique regardless of the Corrade version whereas the English message agent not in group may change or be localised.