GetAllGroups

Description

Returns the names of all the groups the current user can view. The result includes at least the groups the user is a member of. If the user has the All Users and Groups Visible privilege, the list includes all groups that are subscribed to the database.

Syntax

VBScript


session.GetAllGroups (extend_option)

Perl


$session->GetAllGroups(extend_option); 
Identifier
Description
session
The Session object that represents the current database-access session.
extend_option
A Long that specifies an Extended Name Option enumeration value.
Return value
For Visual Basic, a Variant containing an Array of Strings is returned. Each String contains the name of a group.

For Perl, returns a reference to an array of strings containing the names of all groups a user can see.

Example

Perl

sub show_all_groups()
{
    my $groups;
    eval {
        $groups = $session->GetAllGroups($CQPerlExt::CQ_NAME_EXTEND_WHEN_NEEDED);
    };
    if ($@) {
        print "WARNING: failed to get all groups: $@\n";
    } else {
        my $group;
        print "All groups:";
        foreach $group (sort @$groups) {
            print " $group";
        }
        print "\n";
    }
}