From aa7cadca5233dccf478af93be88b59fc08fc2ecd Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 24 Jul 2010 23:36:07 +0100 Subject: [PATCH] Add some options --- .../Services/InventoryService/XInventoryService.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 79afc8d2a5..f581f76d90 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService MethodBase.GetCurrentMethod().DeclaringType); protected IXInventoryData m_Database; + protected bool m_AllowDelete = true; public XInventoryService(IConfigSource config) : base(config) { @@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService { dllName = authConfig.GetString("StorageProvider", dllName); connString = authConfig.GetString("ConnectionString", connString); + m_AllowDelete = authConfig.GetBoolean("AllowDelete", true); // realm = authConfig.GetString("Realm", realm); } @@ -304,6 +306,9 @@ namespace OpenSim.Services.InventoryService // public virtual bool DeleteFolders(UUID principalID, List folderIDs) { + if (!m_AllowDelete) + return false; + // Ignore principal ID, it's bogus at connector level // foreach (UUID id in folderIDs) @@ -321,6 +326,9 @@ namespace OpenSim.Services.InventoryService public virtual bool PurgeFolder(InventoryFolderBase folder) { + if (!m_AllowDelete) + return false; + if (!ParentIsTrash(folder.ID)) return false; @@ -363,6 +371,9 @@ namespace OpenSim.Services.InventoryService public virtual bool DeleteItems(UUID principalID, List itemIDs) { + if (!m_AllowDelete) + return false; + // Just use the ID... *facepalms* // foreach (UUID id in itemIDs)