From b4ce78796b0eaa41c260d9865df7170b10867b3f 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 312c595449..be275c0f4a 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); } @@ -295,6 +297,9 @@ namespace OpenSim.Services.InventoryService // public 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) @@ -312,6 +317,9 @@ namespace OpenSim.Services.InventoryService public bool PurgeFolder(InventoryFolderBase folder) { + if (!m_AllowDelete) + return false; + if (!ParentIsTrash(folder.ID)) return false; @@ -354,6 +362,9 @@ namespace OpenSim.Services.InventoryService public bool DeleteItems(UUID principalID, List itemIDs) { + if (!m_AllowDelete) + return false; + // Just use the ID... *facepalms* // foreach (UUID id in itemIDs)