aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2013-08-03 20:13:44 -0700
committerDiva Canto2013-08-03 20:13:44 -0700
commitdcfeb95e98ca7b002170a5916f556f54f300678c (patch)
tree756725cd35de68ab4f535cfce0ad0d3fd9b5e8e7
parentMaking the J2KDecoderModule decoder function async. Could this be the cause o... (diff)
downloadopensim-SC-dcfeb95e98ca7b002170a5916f556f54f300678c.zip
opensim-SC-dcfeb95e98ca7b002170a5916f556f54f300678c.tar.gz
opensim-SC-dcfeb95e98ca7b002170a5916f556f54f300678c.tar.bz2
opensim-SC-dcfeb95e98ca7b002170a5916f556f54f300678c.tar.xz
HG: If OutboundPermission is set to false, let's enforce stricter permissions by not allowing objects to be taken to inventory.
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs3
2 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 8f9800f..978c288 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -62,6 +62,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
62 private string m_ThisGatekeeper; 62 private string m_ThisGatekeeper;
63 private bool m_RestrictInventoryAccessAbroad; 63 private bool m_RestrictInventoryAccessAbroad;
64 64
65 private bool m_bypassPermissions = true;
66
65// private bool m_Initialized = false; 67// private bool m_Initialized = false;
66 68
67 #region INonSharedRegionModule 69 #region INonSharedRegionModule
@@ -100,6 +102,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
100 } 102 }
101 else 103 else
102 m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!"); 104 m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!");
105
106 m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(source, "serverside_object_permissions",
107 new string[] { "Startup", "Permissions" }, true);
108
103 } 109 }
104 } 110 }
105 } 111 }
@@ -114,6 +120,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
114 scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem; 120 scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem;
115 scene.EventManager.OnTeleportStart += TeleportStart; 121 scene.EventManager.OnTeleportStart += TeleportStart;
116 scene.EventManager.OnTeleportFail += TeleportFail; 122 scene.EventManager.OnTeleportFail += TeleportFail;
123
124 // We're fgoing to enforce some stricter permissions if Outbound is false
125 scene.Permissions.OnTakeObject += CanTakeObject;
126 scene.Permissions.OnTakeCopyObject += CanTakeObject;
127
117 } 128 }
118 129
119 #endregion 130 #endregion
@@ -417,5 +428,25 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
417 } 428 }
418 429
419 #endregion 430 #endregion
431
432 #region Permissions
433
434 private bool CanTakeObject(UUID objectID, UUID stealer, Scene scene)
435 {
436 if (m_bypassPermissions) return true;
437
438 if (!m_OutboundPermission && !UserManagementModule.IsLocalGridUser(stealer))
439 {
440 SceneObjectGroup sog = null;
441 if (m_Scene.TryGetSceneObjectGroup(objectID, out sog) && sog.OwnerID == stealer)
442 return true;
443
444 return false;
445 }
446
447 return true;
448 }
449
450 #endregion
420 } 451 }
421} \ No newline at end of file 452} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 58fa18c..2d1a3ef 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2068,7 +2068,10 @@ namespace OpenSim.Region.Framework.Scenes
2068 { 2068 {
2069 // If we don't have permission, stop right here 2069 // If we don't have permission, stop right here
2070 if (!permissionToTakeCopy) 2070 if (!permissionToTakeCopy)
2071 {
2072 remoteClient.SendAlertMessage("You don't have permission to take the object");
2071 return; 2073 return;
2074 }
2072 2075
2073 permissionToTake = true; 2076 permissionToTake = true;
2074 // Don't delete 2077 // Don't delete