HG 2.0: added asset import/export policies at the sim too.
parent
5f97b3e1d9
commit
b542622b3a
|
@ -56,6 +56,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||||
|
|
||||||
private bool m_Enabled = false;
|
private bool m_Enabled = false;
|
||||||
|
|
||||||
|
private AssetPermissions m_AssetPerms;
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
||||||
{
|
{
|
||||||
get { return null; }
|
get { return null; }
|
||||||
|
@ -128,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||||
if (m_LocalAssetServiceURI != string.Empty)
|
if (m_LocalAssetServiceURI != string.Empty)
|
||||||
m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/');
|
m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/');
|
||||||
|
|
||||||
|
IConfig hgConfig = source.Configs["HGAssetService"];
|
||||||
|
m_AssetPerms = new AssetPermissions(hgConfig);
|
||||||
|
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled");
|
m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled");
|
||||||
}
|
}
|
||||||
|
@ -206,14 +211,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||||
asset = m_HGService.Get(id);
|
asset = m_HGService.Get(id);
|
||||||
if (asset != null)
|
if (asset != null)
|
||||||
{
|
{
|
||||||
// Now store it locally
|
// Now store it locally, if allowed
|
||||||
// For now, let me just do it for textures and scripts
|
if (m_AssetPerms.AllowedImport(asset.Type))
|
||||||
if (((AssetType)asset.Type == AssetType.Texture) ||
|
|
||||||
((AssetType)asset.Type == AssetType.LSLBytecode) ||
|
|
||||||
((AssetType)asset.Type == AssetType.LSLText))
|
|
||||||
{
|
|
||||||
m_GridService.Store(asset);
|
m_GridService.Store(asset);
|
||||||
}
|
else
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -328,7 +330,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||||
|
|
||||||
string id = string.Empty;
|
string id = string.Empty;
|
||||||
if (IsHG(asset.ID))
|
if (IsHG(asset.ID))
|
||||||
|
{
|
||||||
|
if (m_AssetPerms.AllowedExport(asset.Type))
|
||||||
id = m_HGService.Store(asset);
|
id = m_HGService.Store(asset);
|
||||||
|
else
|
||||||
|
return String.Empty;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
id = m_GridService.Store(asset);
|
id = m_GridService.Store(asset);
|
||||||
|
|
||||||
|
|
|
@ -437,7 +437,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
||||||
UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
|
UserAccountsService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
|
||||||
HomeURI = "http://127.0.0.1:8002"
|
HomeURI = "http://127.0.0.1:8002"
|
||||||
|
|
||||||
;; The asset types that this service can export to / import from other grids.
|
;; The asset types that this grid can export to / import from other grids.
|
||||||
;; Comma separated.
|
;; Comma separated.
|
||||||
;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
|
;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
|
||||||
;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,
|
;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,
|
||||||
|
|
|
@ -137,6 +137,26 @@
|
||||||
;; uncomment the next line. You may want to do this on sims that have licensed content.
|
;; uncomment the next line. You may want to do this on sims that have licensed content.
|
||||||
; OutboundPermission = False
|
; OutboundPermission = False
|
||||||
|
|
||||||
|
[HGAssetService]
|
||||||
|
;
|
||||||
|
; === HG ONLY ===
|
||||||
|
; Change this to your server
|
||||||
|
; accessible from other grids
|
||||||
|
;
|
||||||
|
HomeURI = "http://mygridserver.com:8002"
|
||||||
|
|
||||||
|
;; The asset types that this grid can export to / import from other grids.
|
||||||
|
;; Comma separated.
|
||||||
|
;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
|
||||||
|
;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,
|
||||||
|
;; LSLBytecode, TextureTGA, Bodypart, SoundWAV, ImageTGA, ImageJPEG, Animation, Gesture, Mesh
|
||||||
|
;;
|
||||||
|
;; Leave blank or commented if you don't want to apply any restrictions.
|
||||||
|
;; A more strict, but still reasonable, policy may be to disallow the exchange
|
||||||
|
;; of scripts, like so:
|
||||||
|
; DisallowExport ="LSLText"
|
||||||
|
; DisallowImport ="LSLBytecode"
|
||||||
|
|
||||||
[HGFriendsModule]
|
[HGFriendsModule]
|
||||||
; User level required to be able to send friendship invitations to foreign users
|
; User level required to be able to send friendship invitations to foreign users
|
||||||
;LevelHGFriends = 0;
|
;LevelHGFriends = 0;
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
[HGAssetService]
|
[HGAssetService]
|
||||||
HomeURI = "http://127.0.0.1:9000"
|
HomeURI = "http://127.0.0.1:9000"
|
||||||
|
|
||||||
;; The asset types that this service can export to / import from other grids.
|
;; The asset types that this grid can export to / import from other grids.
|
||||||
;; Comma separated.
|
;; Comma separated.
|
||||||
;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
|
;; Valid values are all the asset types in OpenMetaverse.AssetType, namely:
|
||||||
;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,
|
;; Unknown, Texture, Sound, CallingCard, Landmark, Clothing, Object, Notecard, LSLText,
|
||||||
|
|
Loading…
Reference in New Issue