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: 2024.2.269.3570
Syntax public Group GetGroup(
string group,
Options options
)
Public Function GetGroup (
group As String,
options As Options
) As Group
public:
Group^ GetGroup(
String^ group,
Options^ options
)
member GetGroup :
group : string *
options : Options -> Group
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:
GroupThe 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