Add some options

0.6.9-post-fixes
Melanie 2010-07-24 23:36:07 +01:00
parent 95230bee6d
commit b4ce78796b
1 changed files with 11 additions and 0 deletions

View File

@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
protected IXInventoryData m_Database; protected IXInventoryData m_Database;
protected bool m_AllowDelete = true;
public XInventoryService(IConfigSource config) : base(config) public XInventoryService(IConfigSource config) : base(config)
{ {
@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService
{ {
dllName = authConfig.GetString("StorageProvider", dllName); dllName = authConfig.GetString("StorageProvider", dllName);
connString = authConfig.GetString("ConnectionString", connString); connString = authConfig.GetString("ConnectionString", connString);
m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
// realm = authConfig.GetString("Realm", realm); // realm = authConfig.GetString("Realm", realm);
} }
@ -295,6 +297,9 @@ namespace OpenSim.Services.InventoryService
// //
public bool DeleteFolders(UUID principalID, List<UUID> folderIDs) public bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
{ {
if (!m_AllowDelete)
return false;
// Ignore principal ID, it's bogus at connector level // Ignore principal ID, it's bogus at connector level
// //
foreach (UUID id in folderIDs) foreach (UUID id in folderIDs)
@ -312,6 +317,9 @@ namespace OpenSim.Services.InventoryService
public bool PurgeFolder(InventoryFolderBase folder) public bool PurgeFolder(InventoryFolderBase folder)
{ {
if (!m_AllowDelete)
return false;
if (!ParentIsTrash(folder.ID)) if (!ParentIsTrash(folder.ID))
return false; return false;
@ -354,6 +362,9 @@ namespace OpenSim.Services.InventoryService
public bool DeleteItems(UUID principalID, List<UUID> itemIDs) public bool DeleteItems(UUID principalID, List<UUID> itemIDs)
{ {
if (!m_AllowDelete)
return false;
// Just use the ID... *facepalms* // Just use the ID... *facepalms*
// //
foreach (UUID id in itemIDs) foreach (UUID id in itemIDs)