aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2012-09-21 07:44:18 -0700
committerDiva Canto2012-09-21 07:44:18 -0700
commitb542622b3a841e73f071aab563ba1e211c5a87e3 (patch)
tree17a26537d37e3d53f610c2bddbd054951c6eb5c1
parentMinor: change the return value of unsuccessful posts to string.Empty. (diff)
downloadopensim-SC_OLD-b542622b3a841e73f071aab563ba1e211c5a87e3.zip
opensim-SC_OLD-b542622b3a841e73f071aab563ba1e211c5a87e3.tar.gz
opensim-SC_OLD-b542622b3a841e73f071aab563ba1e211c5a87e3.tar.bz2
opensim-SC_OLD-b542622b3a841e73f071aab563ba1e211c5a87e3.tar.xz
HG 2.0: added asset import/export policies at the sim too.
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs23
-rw-r--r--bin/Robust.HG.ini.example2
-rw-r--r--bin/config-include/GridCommon.ini.example20
-rw-r--r--bin/config-include/StandaloneCommon.ini.example2
4 files changed, 37 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
index 008465f..0456852 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
@@ -56,6 +56,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
56 56
57 private bool m_Enabled = false; 57 private bool m_Enabled = false;
58 58
59 private AssetPermissions m_AssetPerms;
60
59 public Type ReplaceableInterface 61 public Type ReplaceableInterface
60 { 62 {
61 get { return null; } 63 get { return null; }
@@ -128,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
128 if (m_LocalAssetServiceURI != string.Empty) 130 if (m_LocalAssetServiceURI != string.Empty)
129 m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/'); 131 m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/');
130 132
133 IConfig hgConfig = source.Configs["HGAssetService"];
134 m_AssetPerms = new AssetPermissions(hgConfig);
135
131 m_Enabled = true; 136 m_Enabled = true;
132 m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled"); 137 m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled");
133 } 138 }
@@ -206,14 +211,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
206 asset = m_HGService.Get(id); 211 asset = m_HGService.Get(id);
207 if (asset != null) 212 if (asset != null)
208 { 213 {
209 // Now store it locally 214 // Now store it locally, if allowed
210 // For now, let me just do it for textures and scripts 215 if (m_AssetPerms.AllowedImport(asset.Type))
211 if (((AssetType)asset.Type == AssetType.Texture) ||
212 ((AssetType)asset.Type == AssetType.LSLBytecode) ||
213 ((AssetType)asset.Type == AssetType.LSLText))
214 {
215 m_GridService.Store(asset); 216 m_GridService.Store(asset);
216 } 217 else
218 return null;
217 } 219 }
218 } 220 }
219 else 221 else
@@ -328,7 +330,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
328 330
329 string id = string.Empty; 331 string id = string.Empty;
330 if (IsHG(asset.ID)) 332 if (IsHG(asset.ID))
331 id = m_HGService.Store(asset); 333 {
334 if (m_AssetPerms.AllowedExport(asset.Type))
335 id = m_HGService.Store(asset);
336 else
337 return String.Empty;
338 }
332 else 339 else
333 id = m_GridService.Store(asset); 340 id = m_GridService.Store(asset);
334 341
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index 399779d..afb3f6f 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -437,7 +437,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
437 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService" 437 UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
438 HomeURI = "http://127.0.0.1:8002" 438 HomeURI = "http://127.0.0.1:8002"
439 439
440 ;; The asset types that this service can export to / import from other grids. 440 ;; The asset types that this grid can export to / import from other grids.
441 ;; Comma separated. 441 ;; Comma separated.
442 ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: 442 ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
443 ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, 443 ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,
diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example
index 8d7f6fc..79f7ed6 100644
--- a/bin/config-include/GridCommon.ini.example
+++ b/bin/config-include/GridCommon.ini.example
@@ -137,6 +137,26 @@
137 ;; uncomment the next line. You may want to do this on sims that have licensed content. 137 ;; uncomment the next line. You may want to do this on sims that have licensed content.
138 ; OutboundPermission = False 138 ; OutboundPermission = False
139 139
140[HGAssetService]
141 ;
142 ; === HG ONLY ===
143 ; Change this to your server
144 ; accessible from other grids
145 ;
146 HomeURI = "http://mygridserver.com:8002"
147
148 ;; The asset types that this grid can export to / import from other grids.
149 ;; Comma separated.
150 ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
151 ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,
152 ;; LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh
153 ;;
154 ;; Leave blank or commented if you don't want to apply any restrictions.
155 ;; A more strict, but still reasonable, policy may be to disallow the exchange
156 ;; of scripts, like so:
157 ; DisallowExport ="LSLText"
158 ; DisallowImport ="LSLBytecode"
159
140[HGFriendsModule] 160[HGFriendsModule]
141 ; User level required to be able to send friendship invitations to foreign users 161 ; User level required to be able to send friendship invitations to foreign users
142 ;LevelHGFriends = 0; 162 ;LevelHGFriends = 0;
diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example
index d5eb50d..048710a 100644
--- a/bin/config-include/StandaloneCommon.ini.example
+++ b/bin/config-include/StandaloneCommon.ini.example
@@ -53,7 +53,7 @@
53[HGAssetService] 53[HGAssetService]
54 HomeURI = "http://127.0.0.1:9000" 54 HomeURI = "http://127.0.0.1:9000"
55 55
56 ;; The asset types that this service can export to / import from other grids. 56 ;; The asset types that this grid can export to / import from other grids.
57 ;; Comma separated. 57 ;; Comma separated.
58 ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely: 58 ;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
59 ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText, 59 ;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,