/// <summary> /// Deletes the specified connection group and user group. /// </summary> /// <param name="userId">User identifier.</param> /// <param name="groupName">Group name.</param> public void DeleteGroup(string userId, string groupName) { List <Exception> excepts = new List <Exception>(); GuacamoleDatabaseDeleter deleter = new GuacamoleDatabaseDeleter(); deleter.DeleteUserGroup(groupName, ref excepts); deleter.DeleteConnectionGroup(groupName, ref excepts); if (excepts.Count == 0) { return; } else { Console.Write("Error"); return; } }
public async Task <IActionResult> DeleteGroup(GroupNameDto groupNameDto) { List <Exception> excepts = new List <Exception>(); GuacamoleDatabaseDeleter deleter = new GuacamoleDatabaseDeleter(); deleter.DeleteUserGroup(groupNameDto.Name, ref excepts); deleter.DeleteConnectionGroup(groupNameDto.Name, ref excepts); if (excepts.Count == 0) { return(Ok()); } else { var message = HandleErrors(excepts); return(BadRequest(message)); } }