OnGroupDeleted
Called when a group has been deleted successfully
Usage
- No return behavior
Example Autogenerated
csharp
private void OnGroupDeleted( string name )
{
Puts( "OnGroupDeleted works!" );
}
Location
- Permission::RemoveGroup(string groupName)
csharp
public bool RemoveGroup(string groupName)
{
// Check if it even exists
if (!GroupExists(groupName))
{
return false;
}
// Remove the group
bool removed = groupsData.Remove(groupName);
if (removed)
{
// Set children to having no parent group
foreach (GroupData child in groupsData.Values.Where(g => g.ParentGroup == groupName))
{
child.ParentGroup = string.Empty;
}
}
// Remove group from users
bool changed = usersData.Values.Aggregate(false, (current, userData) => current | userData.Groups.Remove(groupName));
if (changed)
{
SaveUsers();
}
if (removed)
{
Interface.CallHook("OnGroupDeleted", groupName);
}
return true;
}