Add some options

prebuild-update
Melanie 2010-07-24 23:36:07 +01:00
parent a9b7774fe0
commit aa7cadca52
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);
} }
@ -304,6 +306,9 @@ namespace OpenSim.Services.InventoryService
// //
public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) public virtual 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)
@ -321,6 +326,9 @@ namespace OpenSim.Services.InventoryService
public virtual bool PurgeFolder(InventoryFolderBase folder) public virtual bool PurgeFolder(InventoryFolderBase folder)
{ {
if (!m_AllowDelete)
return false;
if (!ParentIsTrash(folder.ID)) if (!ParentIsTrash(folder.ID))
return false; return false;
@ -363,6 +371,9 @@ namespace OpenSim.Services.InventoryService
public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) public virtual 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)