public function deleteResourceGroup($groupName)
{
try {
$result = $this->getGroupsCollection()->deleteOne(['name' => $groupName]);
if ($result->getDeletedCount()) {
// Remove from local cache
unset($this->groups[$groupName]);
// Also remove ACL rules that depended on this group
$this->getAclCollection()->updateMany(['acl.group' => $groupName], ['$pull' => ['acl' => ['group' => $groupName]]]);
}
return (bool) $result->getDeletedCount();
} catch (MongoException $e) {
throw new DatabaseException('Could not delete resource group from database', 500, $e);
}
}