From 4b924f2eb6e796b696d94ec0dcf9865b1e4a8e49 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 8 May 2008 19:22:20 +0000 Subject: * Committing an extra bit of permissions for attaching to ensure that the perms are in line with project goals. --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 69 ++++++++++++++----------- 1 file changed, 38 insertions(+), 31 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 9d4119d..7ffddb3 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -338,6 +338,7 @@ namespace OpenSim.Region.Environment.Scenes public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot) { // Calls attach with a Zero position + AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); } public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) @@ -393,46 +394,52 @@ namespace OpenSim.Region.Environment.Scenes if (((SceneObjectGroup)obj).LocalId == objectLocalID) { SceneObjectGroup group = (SceneObjectGroup)obj; - - // If the attachment point isn't the same as the one previously used - // set it's offset position = 0 so that it appears on the attachment point - // and not in a weird location somewhere unknown. - if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) + if (m_parentScene.Permissions.CanEditObject(remoteClient.AgentId, obj.UUID)) { + // If the attachment point isn't the same as the one previously used + // set it's offset position = 0 so that it appears on the attachment point + // and not in a weird location somewhere unknown. + if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) + { - attachPos = LLVector3.Zero; - } + attachPos = LLVector3.Zero; + } - // AttachmentPt 0 means the client chose to 'wear' the attachment. - if (AttachmentPt == 0) - { - - // Check object for stored attachment point - AttachmentPt = (uint)group.GetAttachmentPoint(); - + // AttachmentPt 0 means the client chose to 'wear' the attachment. + if (AttachmentPt == 0) + { - } + // Check object for stored attachment point + AttachmentPt = (uint)group.GetAttachmentPoint(); - // if we still didn't find a suitable attachment point....... - if (AttachmentPt == 0) - { - // Stick it on left hand with Zero Offset from the attachment point. - AttachmentPt = (uint)AttachmentPoint.LeftHand; - attachPos = LLVector3.Zero; - } + + } + + // if we still didn't find a suitable attachment point....... + if (AttachmentPt == 0) + { + // Stick it on left hand with Zero Offset from the attachment point. + AttachmentPt = (uint)AttachmentPoint.LeftHand; + attachPos = LLVector3.Zero; + } m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt.ToString()); - - - // Saves and gets assetID - if (group.GetFromAssetID() == LLUUID.Zero) - { - LLUUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); - // sets assetID so client can show asset as 'attached' in inventory - group.SetFromAssetID(newAssetID); + + // Saves and gets assetID + if (group.GetFromAssetID() == LLUUID.Zero) + { + LLUUID newAssetID = m_parentScene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId); + + // sets assetID so client can show asset as 'attached' in inventory + group.SetFromAssetID(newAssetID); + } + group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); + } + else + { + remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false); } - group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); } -- cgit v1.1