aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Asset
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Asset')
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs4
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs8
2 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index f7eb292..b6425f4 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -59,9 +59,11 @@ namespace OpenSim.Server.Handlers.Asset
59 m_AssetService = 59 m_AssetService =
60 ServerUtils.LoadPlugin<IAssetService>(assetService, args); 60 ServerUtils.LoadPlugin<IAssetService>(assetService, args);
61 61
62 bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false);
63
62 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); 64 server.AddStreamHandler(new AssetServerGetHandler(m_AssetService));
63 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService)); 65 server.AddStreamHandler(new AssetServerPostHandler(m_AssetService));
64 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService)); 66 server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowDelete));
65 } 67 }
66 } 68 }
67} 69}
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
index f33bb90..8014fb5 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
@@ -47,11 +47,13 @@ namespace OpenSim.Server.Handlers.Asset
47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private IAssetService m_AssetService; 49 private IAssetService m_AssetService;
50 protected bool m_allowDelete;
50 51
51 public AssetServerDeleteHandler(IAssetService service) : 52 public AssetServerDeleteHandler(IAssetService service, bool allowDelete) :
52 base("DELETE", "/assets") 53 base("DELETE", "/assets")
53 { 54 {
54 m_AssetService = service; 55 m_AssetService = service;
56 m_allowDelete = allowDelete;
55 } 57 }
56 58
57 public override byte[] Handle(string path, Stream request, 59 public override byte[] Handle(string path, Stream request,
@@ -61,9 +63,9 @@ namespace OpenSim.Server.Handlers.Asset
61 63
62 string[] p = SplitParams(path); 64 string[] p = SplitParams(path);
63 65
64 if (p.Length > 0) 66 if (p.Length > 0 && m_allowDelete)
65 { 67 {
66 // result = m_AssetService.Delete(p[0]); 68 result = m_AssetService.Delete(p[0]);
67 } 69 }
68 70
69 XmlSerializer xs = new XmlSerializer(typeof(bool)); 71 XmlSerializer xs = new XmlSerializer(typeof(bool));