aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-01-19 13:10:04 +0000
committerUbitUmarov2017-01-19 13:10:04 +0000
commit984345a2022ba805869990e0c495af08ffe40ce9 (patch)
tree3ce9db584eb319a4141cd930723c79a3a061f2e9 /OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
parentfix a null check (diff)
downloadopensim-SC-984345a2022ba805869990e0c495af08ffe40ce9.zip
opensim-SC-984345a2022ba805869990e0c495af08ffe40ce9.tar.gz
opensim-SC-984345a2022ba805869990e0c495af08ffe40ce9.tar.bz2
opensim-SC-984345a2022ba805869990e0c495af08ffe40ce9.tar.xz
add CanEdit check for SOGs, iclients and SPs that need to be in scene and use it
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs44
1 files changed, 34 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index e066c0a..3491792 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -48,7 +48,8 @@ namespace OpenSim.Region.Framework.Scenes
48 public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); 48 public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene);
49 public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp); 49 public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp);
50 public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); 50 public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition);
51 public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene); 51 public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID, Scene scene);
52 public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp);
52 public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); 53 public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
53 public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp); 54 public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp);
54 public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); 55 public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene);
@@ -118,6 +119,7 @@ namespace OpenSim.Region.Framework.Scenes
118 public event SellGroupObjectHandler OnSellGroupObject; 119 public event SellGroupObjectHandler OnSellGroupObject;
119 public event TakeCopyObjectHandler OnTakeCopyObject; 120 public event TakeCopyObjectHandler OnTakeCopyObject;
120 public event DuplicateObjectHandler OnDuplicateObject; 121 public event DuplicateObjectHandler OnDuplicateObject;
122 public event EditObjectByIDsHandler OnEditObjectByIDs;
121 public event EditObjectHandler OnEditObject; 123 public event EditObjectHandler OnEditObject;
122 public event EditObjectInventoryHandler OnEditObjectInventory; 124 public event EditObjectInventoryHandler OnEditObjectInventory;
123 public event MoveObjectHandler OnMoveObject; 125 public event MoveObjectHandler OnMoveObject;
@@ -307,6 +309,9 @@ namespace OpenSim.Region.Framework.Scenes
307 TakeObjectHandler handler = OnTakeObject; 309 TakeObjectHandler handler = OnTakeObject;
308 if (handler != null) 310 if (handler != null)
309 { 311 {
312 if(sog == null || sp == null)
313 return false;
314
310 Delegate[] list = handler.GetInvocationList(); 315 Delegate[] list = handler.GetInvocationList();
311 foreach (TakeObjectHandler h in list) 316 foreach (TakeObjectHandler h in list)
312 { 317 {
@@ -364,6 +369,8 @@ namespace OpenSim.Region.Framework.Scenes
364 TakeCopyObjectHandler handler = OnTakeCopyObject; 369 TakeCopyObjectHandler handler = OnTakeCopyObject;
365 if (handler != null) 370 if (handler != null)
366 { 371 {
372 if(sog == null || sp == null)
373 return false;
367 Delegate[] list = handler.GetInvocationList(); 374 Delegate[] list = handler.GetInvocationList();
368 foreach (TakeCopyObjectHandler h in list) 375 foreach (TakeCopyObjectHandler h in list)
369 { 376 {
@@ -419,13 +426,33 @@ namespace OpenSim.Region.Framework.Scenes
419 #region EDIT OBJECT 426 #region EDIT OBJECT
420 public bool CanEditObject(UUID objectID, UUID editorID) 427 public bool CanEditObject(UUID objectID, UUID editorID)
421 { 428 {
429 EditObjectByIDsHandler handler = OnEditObjectByIDs;
430 if (handler != null)
431 {
432 Delegate[] list = handler.GetInvocationList();
433 foreach (EditObjectByIDsHandler h in list)
434 {
435 if (h(objectID, editorID, m_scene) == false)
436 return false;
437 }
438 }
439 return true;
440 }
441
442 public bool CanEditObject(SceneObjectGroup sog, IClientAPI client)
443 {
422 EditObjectHandler handler = OnEditObject; 444 EditObjectHandler handler = OnEditObject;
423 if (handler != null) 445 if (handler != null)
424 { 446 {
447 if(sog == null || client == null || client.SceneAgent == null)
448 return false;
449
450 ScenePresence sp = client.SceneAgent as ScenePresence;
451
425 Delegate[] list = handler.GetInvocationList(); 452 Delegate[] list = handler.GetInvocationList();
426 foreach (EditObjectHandler h in list) 453 foreach (EditObjectHandler h in list)
427 { 454 {
428 if (h(objectID, editorID, m_scene) == false) 455 if (h(sog, sp) == false)
429 return false; 456 return false;
430 } 457 }
431 } 458 }
@@ -452,17 +479,14 @@ namespace OpenSim.Region.Framework.Scenes
452 #region MOVE OBJECT 479 #region MOVE OBJECT
453 public bool CanMoveObject(SceneObjectGroup sog, IClientAPI client) 480 public bool CanMoveObject(SceneObjectGroup sog, IClientAPI client)
454 { 481 {
455 if(sog == null || client == null)
456 return false;
457
458 if(client.SceneAgent == null)
459 return false;
460
461 ScenePresence sp = client.SceneAgent as ScenePresence;
462
463 MoveObjectHandler handler = OnMoveObject; 482 MoveObjectHandler handler = OnMoveObject;
464 if (handler != null) 483 if (handler != null)
465 { 484 {
485 if(sog == null || client == null || client.SceneAgent == null)
486 return false;
487
488 ScenePresence sp = client.SceneAgent as ScenePresence;
489
466 Delegate[] list = handler.GetInvocationList(); 490 Delegate[] list = handler.GetInvocationList();
467 foreach (MoveObjectHandler h in list) 491 foreach (MoveObjectHandler h in list)
468 { 492 {