Get the record for an existing group from the repository.

Namespace: Perforce.P4
Assembly: p4api.net (in p4api.net.dll) Version: 2017.3.160.836 (2017.3.160.0836)

Syntax

C#
public Group GetGroup(
	string group,
	Options options
)
Visual Basic
Public Function GetGroup ( _
	group As String, _
	options As Options _
) As Group
Visual C++
public:
Group^ GetGroup(
	String^ group, 
	Options^ options
)

Parameters

group
Type: System..::..String
Group name
options
Type: Perforce.P4..::..Options
The Owner Access flag (-a) needs to be used if a user without 'super' access is an 'owner' of that group.

Return Value

The Group object if new group was found, null if creation failed

Examples

To get the group 'everyone' when connected as a user with super access:
CopyC#
string targetGroup = "everyone";
Group group = _repository.GetGroup(targetGroup, null);
To get the group 'Mygroup' when connected as a without super access who is the owner of that group:
CopyC#
string targetGroup = "everyone";
GroupCmdOptions opts = new GroupCmdOptions(GroupCmdFlags.OwnerAccess);
Group group = _repository.GetGroup(targetGroup, opts);

See Also