Delete a 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 void DeleteGroup(
	Group group,
	Options options
)
Visual Basic
Public Sub DeleteGroup ( _
	group As Group, _
	options As Options _
)
Visual C++
public:
void DeleteGroup(
	Group^ group, 
	Options^ options
)

Parameters

group
Type: Perforce.P4..::..Group
The group to be deleted
options
Type: Perforce.P4..::..Options
The -a flag is needed to delete a group when the user is an owner but not a superuser

Examples

To delete the group 'Mygroup' when the user is a superuser:
CopyC#
string targetGroup = "Mygroup";
Group group = new Group();
group.Id = targetGroup;
_repository.DeleteGroup(group, null);
To delete the group 'Mygroup' when the user is an owner but not a superuser:
CopyC#
string targetGroup = "Mygroup";
Group group = new _repository.GetGroup(targetGroup);
GroupCmdOptions opts = new GroupCmdOptions(GroupCmdFlags.OwnerAccess);
_repository.DeleteGroup(group, opts);

See Also