aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-01-22 03:23:50 +0000
committerUbitUmarov2017-01-22 03:23:50 +0000
commit50e318c401f69b7b3946b0a630d455bf7fe4118c (patch)
treefcdf94348e955ee39325a97ff05bb067a0d5ecdd /OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
parenta few more changes on permissions (diff)
downloadopensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.zip
opensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.tar.gz
opensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.tar.bz2
opensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.tar.xz
work around group sharing and owned permitions issues, fix a non copy objects delete issue
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs32
1 files changed, 30 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index e941210..754609a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -42,7 +42,8 @@ namespace OpenSim.Region.Framework.Scenes
42 public delegate bool BypassPermissionsHandler(); 42 public delegate bool BypassPermissionsHandler();
43 public delegate bool PropagatePermissionsHandler(); 43 public delegate bool PropagatePermissionsHandler();
44 public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene); 44 public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene);
45 public delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene); 45 public delegate bool DeleteObjectHandlerByIDs(UUID objectID, UUID deleter, Scene scene);
46 public delegate bool DeleteObjectHandler(SceneObjectGroup sog, ScenePresence sp);
46 public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene); 47 public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene);
47 public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp); 48 public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp);
48 public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); 49 public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene);
@@ -114,6 +115,7 @@ namespace OpenSim.Region.Framework.Scenes
114 public event BypassPermissionsHandler OnBypassPermissions; 115 public event BypassPermissionsHandler OnBypassPermissions;
115 public event PropagatePermissionsHandler OnPropagatePermissions; 116 public event PropagatePermissionsHandler OnPropagatePermissions;
116 public event RezObjectHandler OnRezObject; 117 public event RezObjectHandler OnRezObject;
118 public event DeleteObjectHandlerByIDs OnDeleteObjectByIDs;
117 public event DeleteObjectHandler OnDeleteObject; 119 public event DeleteObjectHandler OnDeleteObject;
118 public event TransferObjectHandler OnTransferObject; 120 public event TransferObjectHandler OnTransferObject;
119 public event TakeObjectHandler OnTakeObject; 121 public event TakeObjectHandler OnTakeObject;
@@ -262,13 +264,39 @@ namespace OpenSim.Region.Framework.Scenes
262 { 264 {
263 bool result = true; 265 bool result = true;
264 266
267 DeleteObjectHandlerByIDs handler = OnDeleteObjectByIDs;
268 if (handler != null)
269 {
270 Delegate[] list = handler.GetInvocationList();
271 foreach (DeleteObjectHandlerByIDs h in list)
272 {
273 if (h(objectID, deleter, m_scene) == false)
274 {
275 result = false;
276 break;
277 }
278 }
279 }
280
281 return result;
282 }
283
284 public bool CanDeleteObject(SceneObjectGroup sog, IClientAPI client)
285 {
286 bool result = true;
287
265 DeleteObjectHandler handler = OnDeleteObject; 288 DeleteObjectHandler handler = OnDeleteObject;
266 if (handler != null) 289 if (handler != null)
267 { 290 {
291 if(sog == null || client == null || client.SceneAgent == null)
292 return false;
293
294 ScenePresence sp = client.SceneAgent as ScenePresence;
295
268 Delegate[] list = handler.GetInvocationList(); 296 Delegate[] list = handler.GetInvocationList();
269 foreach (DeleteObjectHandler h in list) 297 foreach (DeleteObjectHandler h in list)
270 { 298 {
271 if (h(objectID, deleter, m_scene) == false) 299 if (h(sog, sp) == false)
272 { 300 {
273 result = false; 301 result = false;
274 break; 302 break;