aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 6c57d18..e031ebc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2577,5 +2577,73 @@ namespace OpenSim.Region.Framework.Scenes
2577 part.GetProperties(remoteClient); 2577 part.GetProperties(remoteClient);
2578 } 2578 }
2579 } 2579 }
2580
2581 public void DelinkObjects(List<uint> primIds, IClientAPI client)
2582 {
2583 List<SceneObjectPart> parts = new List<SceneObjectPart>();
2584
2585 foreach (uint localID in primIds)
2586 {
2587 SceneObjectPart part = GetSceneObjectPart(localID);
2588
2589 if (part == null)
2590 continue;
2591
2592 if (Permissions.CanDelinkObject(client.AgentId, part.ParentGroup.RootPart.UUID))
2593 parts.Add(part);
2594 }
2595
2596 m_sceneGraph.DelinkObjects(parts);
2597 }
2598
2599 public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds)
2600 {
2601 List<UUID> owners = new List<UUID>();
2602
2603 List<SceneObjectPart> children = new List<SceneObjectPart>();
2604 SceneObjectPart root = GetSceneObjectPart(parentPrimId);
2605
2606 if (root == null)
2607 {
2608 m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId);
2609 return;
2610 }
2611
2612 if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID))
2613 {
2614 m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim");
2615 return;
2616 }
2617
2618 foreach (uint localID in childPrimIds)
2619 {
2620 SceneObjectPart part = GetSceneObjectPart(localID);
2621
2622 if (part == null)
2623 continue;
2624
2625 if (!owners.Contains(part.OwnerID))
2626 owners.Add(part.OwnerID);
2627
2628 if (Permissions.CanLinkObject(client.AgentId, part.ParentGroup.RootPart.UUID))
2629 children.Add(part);
2630 }
2631
2632 // Must be all one owner
2633 //
2634 if (owners.Count > 1)
2635 {
2636 m_log.DebugFormat("[LINK]: Refusing link. Too many owners");
2637 return;
2638 }
2639
2640 if (children.Count == 0)
2641 {
2642 m_log.DebugFormat("[LINK]: Refusing link. No permissions to link any of the children");
2643 return;
2644 }
2645
2646 m_sceneGraph.LinkObjects(root, children);
2647 }
2580 } 2648 }
2581} 2649}