GetUserGroups

Description

Returns a list of active user groups to which the current user belongs.

The returned list can be empty.

Syntax

Perl


$session->GetUserGroups();
Identifier
Description
session
The Session object that represents the current database-access session.
Return value

A reference to an array of strings is returned.

Example

Perl


use strict;

use CQPerlExt;



# Create session object

my $sessionObj = CQSession::Build();

$sessionObj->UserLogon("user", "password", "SAMPL", "");



# get the user groups

my $userGroups = $sessionObj->GetUserGroups();



if (!@$userGroups) {

    #Code to handle if no user groups exist

    print "no user groups\n";

}

else {

    # print out all groups

    foreach my $group (@$userGroups) {

        print "Group $group\n";

    }

}

exit(0);

CQSession::Unbuild($sessionObj);