diff options
Diffstat (limited to 'OpenSim/Region')
5 files changed, 139 insertions, 44 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 37929f2..ec238ef 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -662,8 +662,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
662 | public void ProcessSpecificPacketAsync(object state) | 662 | public void ProcessSpecificPacketAsync(object state) |
663 | { | 663 | { |
664 | AsyncPacketProcess packetObject = (AsyncPacketProcess)state; | 664 | AsyncPacketProcess packetObject = (AsyncPacketProcess)state; |
665 | packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); | 665 | packetObject.result = packetObject.Method(packetObject.ClientView, packetObject.Pack); |
666 | |||
667 | } | 666 | } |
668 | 667 | ||
669 | #endregion Packet Handling | 668 | #endregion Packet Handling |
@@ -7092,32 +7091,89 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7092 | taskID = new UUID(transfer.TransferInfo.Params, 48); | 7091 | taskID = new UUID(transfer.TransferInfo.Params, 48); |
7093 | UUID itemID = new UUID(transfer.TransferInfo.Params, 64); | 7092 | UUID itemID = new UUID(transfer.TransferInfo.Params, 64); |
7094 | UUID requestID = new UUID(transfer.TransferInfo.Params, 80); | 7093 | UUID requestID = new UUID(transfer.TransferInfo.Params, 80); |
7094 | |||
7095 | // m_log.DebugFormat( | ||
7096 | // "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}", | ||
7097 | // requestID, itemID, taskID, Name); | ||
7098 | |||
7095 | if (!(((Scene)m_scene).Permissions.BypassPermissions())) | 7099 | if (!(((Scene)m_scene).Permissions.BypassPermissions())) |
7096 | { | 7100 | { |
7097 | if (taskID != UUID.Zero) // Prim | 7101 | if (taskID != UUID.Zero) // Prim |
7098 | { | 7102 | { |
7099 | SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); | 7103 | SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); |
7100 | if (part == null) | 7104 | if (part == null) |
7105 | { | ||
7106 | m_log.WarnFormat( | ||
7107 | "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist", | ||
7108 | Name, requestID, itemID, taskID); | ||
7101 | return true; | 7109 | return true; |
7110 | } | ||
7102 | 7111 | ||
7103 | if (part.OwnerID != AgentId) | 7112 | TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID); |
7104 | return true; | 7113 | if (tii == null) |
7105 | 7114 | { | |
7106 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 7115 | m_log.WarnFormat( |
7107 | return true; | 7116 | "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist", |
7108 | 7117 | Name, requestID, itemID, taskID); | |
7109 | TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID); | ||
7110 | if (ti == null) | ||
7111 | return true; | ||
7112 | |||
7113 | if (ti.OwnerID != AgentId) | ||
7114 | return true; | ||
7115 | |||
7116 | if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) | ||
7117 | return true; | ||
7118 | |||
7119 | if (ti.AssetID != requestID) | ||
7120 | return true; | 7118 | return true; |
7119 | } | ||
7120 | |||
7121 | if (tii.Type == (int)AssetType.LSLText) | ||
7122 | { | ||
7123 | if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId)) | ||
7124 | return true; | ||
7125 | } | ||
7126 | else if (tii.Type == (int)AssetType.Notecard) | ||
7127 | { | ||
7128 | if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId)) | ||
7129 | return true; | ||
7130 | } | ||
7131 | else | ||
7132 | { | ||
7133 | // TODO: Change this code to allow items other than notecards and scripts to be successfully | ||
7134 | // shared with group. In fact, all this permissions checking should move to an IPermissionsModule | ||
7135 | if (part.OwnerID != AgentId) | ||
7136 | { | ||
7137 | m_log.WarnFormat( | ||
7138 | "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}", | ||
7139 | Name, requestID, itemID, taskID, part.OwnerID); | ||
7140 | return true; | ||
7141 | } | ||
7142 | |||
7143 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | ||
7144 | { | ||
7145 | m_log.WarnFormat( | ||
7146 | "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set", | ||
7147 | Name, requestID, itemID, taskID); | ||
7148 | return true; | ||
7149 | } | ||
7150 | |||
7151 | if (tii.OwnerID != AgentId) | ||
7152 | { | ||
7153 | m_log.WarnFormat( | ||
7154 | "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}", | ||
7155 | Name, requestID, itemID, taskID, tii.OwnerID); | ||
7156 | return true; | ||
7157 | } | ||
7158 | |||
7159 | if (( | ||
7160 | tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) | ||
7161 | != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) | ||
7162 | { | ||
7163 | m_log.WarnFormat( | ||
7164 | "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer", | ||
7165 | Name, requestID, itemID, taskID); | ||
7166 | return true; | ||
7167 | } | ||
7168 | |||
7169 | if (tii.AssetID != requestID) | ||
7170 | { | ||
7171 | m_log.WarnFormat( | ||
7172 | "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}", | ||
7173 | Name, requestID, itemID, taskID, tii.AssetID); | ||
7174 | return true; | ||
7175 | } | ||
7176 | } | ||
7121 | } | 7177 | } |
7122 | else // Agent | 7178 | else // Agent |
7123 | { | 7179 | { |
@@ -7153,7 +7209,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7153 | } | 7209 | } |
7154 | 7210 | ||
7155 | if (assetRequestItem.AssetID != requestID) | 7211 | if (assetRequestItem.AssetID != requestID) |
7212 | { | ||
7213 | m_log.WarnFormat( | ||
7214 | "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", | ||
7215 | Name, requestID, itemID, assetRequestItem.AssetID); | ||
7156 | return true; | 7216 | return true; |
7217 | } | ||
7157 | } | 7218 | } |
7158 | } | 7219 | } |
7159 | } | 7220 | } |
@@ -7700,12 +7761,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7700 | newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask; | 7761 | newTaskItem.GroupPermissions = updatetask.InventoryData.GroupMask; |
7701 | newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask; | 7762 | newTaskItem.EveryonePermissions = updatetask.InventoryData.EveryoneMask; |
7702 | newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask; | 7763 | newTaskItem.NextPermissions = updatetask.InventoryData.NextOwnerMask; |
7764 | |||
7765 | // Unused? Clicking share with group sets GroupPermissions instead, so perhaps this is something | ||
7766 | // different | ||
7703 | //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; | 7767 | //newTaskItem.GroupOwned=updatetask.InventoryData.GroupOwned; |
7704 | newTaskItem.Type = updatetask.InventoryData.Type; | 7768 | newTaskItem.Type = updatetask.InventoryData.Type; |
7705 | newTaskItem.InvType = updatetask.InventoryData.InvType; | 7769 | newTaskItem.InvType = updatetask.InventoryData.InvType; |
7706 | newTaskItem.Flags = updatetask.InventoryData.Flags; | 7770 | newTaskItem.Flags = updatetask.InventoryData.Flags; |
7707 | //newTaskItem.SaleType=updatetask.InventoryData.SaleType; | 7771 | //newTaskItem.SaleType=updatetask.InventoryData.SaleType; |
7708 | //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice;; | 7772 | //newTaskItem.SalePrice=updatetask.InventoryData.SalePrice; |
7709 | newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name); | 7773 | newTaskItem.Name = Util.FieldToString(updatetask.InventoryData.Name); |
7710 | newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description); | 7774 | newTaskItem.Description = Util.FieldToString(updatetask.InventoryData.Description); |
7711 | newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate; | 7775 | newTaskItem.CreationDate = (uint)updatetask.InventoryData.CreationDate; |
@@ -7713,7 +7777,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7713 | newTaskItem, updatetask.UpdateData.LocalID); | 7777 | newTaskItem, updatetask.UpdateData.LocalID); |
7714 | } | 7778 | } |
7715 | } | 7779 | } |
7716 | } | 7780 | } |
7717 | 7781 | ||
7718 | return true; | 7782 | return true; |
7719 | } | 7783 | } |
@@ -11346,8 +11410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11346 | // } | 11410 | // } |
11347 | } | 11411 | } |
11348 | 11412 | ||
11349 | //check to see if asset is in local cache, if not we need to request it from asset server. | 11413 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); |
11350 | //m_log.Debug("asset request " + requestID); | ||
11351 | 11414 | ||
11352 | m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); | 11415 | m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); |
11353 | 11416 | ||
@@ -11628,6 +11691,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11628 | public PacketMethod method; | 11691 | public PacketMethod method; |
11629 | public bool Async; | 11692 | public bool Async; |
11630 | } | 11693 | } |
11694 | |||
11631 | public class AsyncPacketProcess | 11695 | public class AsyncPacketProcess |
11632 | { | 11696 | { |
11633 | public bool result = false; | 11697 | public bool result = false; |
@@ -11670,4 +11734,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11670 | OutPacket(packet, ThrottleOutPacketType.Task); | 11734 | OutPacket(packet, ThrottleOutPacketType.Task); |
11671 | } | 11735 | } |
11672 | } | 11736 | } |
11673 | } | 11737 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index b557186..a972ca6 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -145,7 +145,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
145 | private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>(); | 145 | private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>(); |
146 | private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>(); | 146 | private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>(); |
147 | private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>(); | 147 | private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>(); |
148 | private IFriendsModule m_friendsModule = null; | 148 | private IFriendsModule m_friendsModule; |
149 | private IGroupsModule m_groupsModule; | ||
149 | 150 | ||
150 | #endregion | 151 | #endregion |
151 | 152 | ||
@@ -370,9 +371,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
370 | m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); | 371 | m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); |
371 | 372 | ||
372 | if (m_friendsModule == null) | 373 | if (m_friendsModule == null) |
373 | m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); | 374 | m_log.Warn("[PERMISSIONS]: Friends module not found, friend permissions will not work"); |
374 | else | 375 | |
375 | m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); | 376 | m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>(); |
377 | |||
378 | if (m_groupsModule == null) | ||
379 | m_log.Warn("[PERMISSIONS]: Groups module not found, group permissions will not work"); | ||
376 | } | 380 | } |
377 | 381 | ||
378 | public void Close() | 382 | public void Close() |
@@ -407,14 +411,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
407 | // with the powers requested (powers = 0 for no powers check) | 411 | // with the powers requested (powers = 0 for no powers check) |
408 | protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) | 412 | protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) |
409 | { | 413 | { |
410 | ScenePresence sp = m_scene.GetScenePresence(userID); | 414 | if (null == m_groupsModule) |
411 | if (sp != null) | 415 | return false; |
412 | { | ||
413 | IClientAPI client = sp.ControllingClient; | ||
414 | 416 | ||
415 | return ((groupID == client.ActiveGroupId) && (client.ActiveGroupPowers != 0) && | 417 | GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, userID); |
416 | ((powers == 0) || ((client.ActiveGroupPowers & powers) == powers))); | 418 | |
419 | if (gmd != null) | ||
420 | { | ||
421 | if (((gmd.GroupPowers != 0) && powers == 0) || (gmd.GroupPowers & powers) == powers) | ||
422 | return true; | ||
417 | } | 423 | } |
424 | |||
418 | return false; | 425 | return false; |
419 | } | 426 | } |
420 | 427 | ||
@@ -705,8 +712,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
705 | permission = false; | 712 | permission = false; |
706 | } | 713 | } |
707 | 714 | ||
715 | // m_log.DebugFormat( | ||
716 | // "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}", | ||
717 | // group.GroupID, | ||
718 | // m_scene.GetSceneObjectPart(objId).GroupMask, | ||
719 | // IsGroupMember(group.GroupID, currentUser, 0), | ||
720 | // currentUser); | ||
721 | |||
708 | // Group members should be able to edit group objects | 722 | // Group members should be able to edit group objects |
709 | if ((group.GroupID != UUID.Zero) && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) && IsGroupMember(group.GroupID, currentUser, 0)) | 723 | if ((group.GroupID != UUID.Zero) |
724 | && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) | ||
725 | && IsGroupMember(group.GroupID, currentUser, 0)) | ||
710 | { | 726 | { |
711 | // Return immediately, so that the administrator can shares group objects | 727 | // Return immediately, so that the administrator can shares group objects |
712 | return true; | 728 | return true; |
@@ -941,7 +957,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
941 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 957 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
942 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 958 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
943 | 959 | ||
944 | |||
945 | return GenericObjectPermission(editorID, objectID, false); | 960 | return GenericObjectPermission(editorID, objectID, false); |
946 | } | 961 | } |
947 | 962 | ||
@@ -1048,7 +1063,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1048 | 1063 | ||
1049 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) | 1064 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) |
1050 | return false; | 1065 | return false; |
1051 | } else { | 1066 | } |
1067 | else | ||
1068 | { | ||
1052 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1069 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1053 | return false; | 1070 | return false; |
1054 | } | 1071 | } |
@@ -1064,7 +1081,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1064 | return false; | 1081 | return false; |
1065 | 1082 | ||
1066 | if (!IsGroupMember(ti.GroupID, user, 0)) | 1083 | if (!IsGroupMember(ti.GroupID, user, 0)) |
1067 | return false; | 1084 | return false; |
1068 | } | 1085 | } |
1069 | 1086 | ||
1070 | // Require full perms | 1087 | // Require full perms |
@@ -1468,14 +1485,16 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1468 | if (part.OwnerID != user) | 1485 | if (part.OwnerID != user) |
1469 | { | 1486 | { |
1470 | if (part.GroupID == UUID.Zero) | 1487 | if (part.GroupID == UUID.Zero) |
1471 | return false; | 1488 | return false; |
1472 | 1489 | ||
1473 | if (!IsGroupMember(part.GroupID, user, 0)) | 1490 | if (!IsGroupMember(part.GroupID, user, 0)) |
1474 | return false; | 1491 | return false; |
1475 | 1492 | ||
1476 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) | 1493 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) |
1477 | return false; | 1494 | return false; |
1478 | } else { | 1495 | } |
1496 | else | ||
1497 | { | ||
1479 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1498 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1480 | return false; | 1499 | return false; |
1481 | } | 1500 | } |
@@ -1791,7 +1810,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1791 | // Is it correct to be less restrictive for lists of objects to be returned? | 1810 | // Is it correct to be less restrictive for lists of objects to be returned? |
1792 | } | 1811 | } |
1793 | 1812 | ||
1794 | private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) { | 1813 | private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) |
1814 | { | ||
1795 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); | 1815 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); |
1796 | switch (scriptType) { | 1816 | switch (scriptType) { |
1797 | case 0: | 1817 | case 0: |
@@ -1825,4 +1845,4 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1825 | return(false); | 1845 | return(false); |
1826 | } | 1846 | } |
1827 | } | 1847 | } |
1828 | } | 1848 | } \ 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 a11b1f1..79b3cfd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1222,6 +1222,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1222 | item = CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); | 1222 | item = CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); |
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | // If we've found the item in the user's inventory or in the library | ||
1225 | if (item != null) | 1226 | if (item != null) |
1226 | { | 1227 | { |
1227 | part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID); | 1228 | part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 71354b4..4034744 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -173,7 +173,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
173 | item.NextPermissions; | 173 | item.NextPermissions; |
174 | taskItem.NextPermissions = item.NextPermissions; | 174 | taskItem.NextPermissions = item.NextPermissions; |
175 | taskItem.CurrentPermissions |= 8; | 175 | taskItem.CurrentPermissions |= 8; |
176 | } else { | 176 | } |
177 | else | ||
178 | { | ||
177 | taskItem.BasePermissions = item.BasePermissions; | 179 | taskItem.BasePermissions = item.BasePermissions; |
178 | taskItem.CurrentPermissions = item.CurrentPermissions; | 180 | taskItem.CurrentPermissions = item.CurrentPermissions; |
179 | taskItem.CurrentPermissions |= 8; | 181 | taskItem.CurrentPermissions |= 8; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 21ca1de..d175695 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -528,6 +528,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
528 | item.ParentID = m_part.UUID; | 528 | item.ParentID = m_part.UUID; |
529 | item.ParentPartID = m_part.UUID; | 529 | item.ParentPartID = m_part.UUID; |
530 | item.Name = name; | 530 | item.Name = name; |
531 | item.GroupID = m_part.GroupID; | ||
531 | 532 | ||
532 | lock (m_items) | 533 | lock (m_items) |
533 | { | 534 | { |
@@ -620,6 +621,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
620 | item.ParentID = m_part.UUID; | 621 | item.ParentID = m_part.UUID; |
621 | item.ParentPartID = m_part.UUID; | 622 | item.ParentPartID = m_part.UUID; |
622 | item.Flags = m_items[item.ItemID].Flags; | 623 | item.Flags = m_items[item.ItemID].Flags; |
624 | |||
625 | // If group permissions have been set on, check that the groupID is up to date in case it has | ||
626 | // changed since permissions were last set. | ||
627 | if (item.GroupPermissions != (uint)PermissionMask.None) | ||
628 | item.GroupID = m_part.GroupID; | ||
629 | |||
623 | if (item.AssetID == UUID.Zero) | 630 | if (item.AssetID == UUID.Zero) |
624 | { | 631 | { |
625 | item.AssetID = m_items[item.ItemID].AssetID; | 632 | item.AssetID = m_items[item.ItemID].AssetID; |
@@ -771,6 +778,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
771 | uint everyoneMask = 0; | 778 | uint everyoneMask = 0; |
772 | uint baseMask = item.BasePermissions; | 779 | uint baseMask = item.BasePermissions; |
773 | uint ownerMask = item.CurrentPermissions; | 780 | uint ownerMask = item.CurrentPermissions; |
781 | uint groupMask = item.GroupPermissions; | ||
774 | 782 | ||
775 | invString.AddItemStart(); | 783 | invString.AddItemStart(); |
776 | invString.AddNameValueLine("item_id", item.ItemID.ToString()); | 784 | invString.AddNameValueLine("item_id", item.ItemID.ToString()); |
@@ -780,7 +788,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
780 | 788 | ||
781 | invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); | 789 | invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); |
782 | invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); | 790 | invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); |
783 | invString.AddNameValueLine("group_mask", Utils.UIntToHexString(0)); | 791 | invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask)); |
784 | invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); | 792 | invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); |
785 | invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); | 793 | invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); |
786 | 794 | ||