Click or drag to resize

RepositoryGetGroup Method (String, Options)

Get the record for an existing group from the repository.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public Group GetGroup(
	string group,
	Options options
)

Parameters

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

Return Value

Type: Group
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:
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:
string targetGroup = "everyone";
GroupCmdOptions opts = new GroupCmdOptions(GroupCmdFlags.OwnerAccess);
Group group = _repository.GetGroup(targetGroup, opts);
See Also