aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-07-23 22:37:10 +0100
committerJustin Clark-Casey (justincc)2010-07-23 22:37:10 +0100
commit18117d8c9acc0df92608e6d920b901cb5c18bc37 (patch)
tree798b4f2697115fd774c9d436592fc15eb86b32a9 /OpenSim/Region/Framework
parentMerge branch '0.7-post-fixes' of ssh://opensimulator.org/var/git/opensim into... (diff)
parentFlipped the flavour on post-fixes to Post_Fixes. (diff)
downloadopensim-SC_OLD-18117d8c9acc0df92608e6d920b901cb5c18bc37.zip
opensim-SC_OLD-18117d8c9acc0df92608e6d920b901cb5c18bc37.tar.gz
opensim-SC_OLD-18117d8c9acc0df92608e6d920b901cb5c18bc37.tar.bz2
opensim-SC_OLD-18117d8c9acc0df92608e6d920b901cb5c18bc37.tar.xz
Merge branch '0.7-post-fixes' of ssh://opensimulator.org/var/git/opensim into 0.7-post-fixes
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs2
5 files changed, 65 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 96a9d97..d79a7f1 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -915,6 +915,9 @@ namespace OpenSim.Region.Framework.Scenes
915 SceneObjectGroup group = part.ParentGroup; 915 SceneObjectGroup group = part.ParentGroup;
916 if (group != null) 916 if (group != null)
917 { 917 {
918 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
919 return;
920
918 TaskInventoryItem item = group.GetInventoryItem(localID, itemID); 921 TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
919 if (item == null) 922 if (item == null)
920 return; 923 return;
@@ -1054,9 +1057,21 @@ namespace OpenSim.Region.Framework.Scenes
1054 return; 1057 return;
1055 } 1058 }
1056 1059
1057 // Only owner can copy 1060 TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId);
1058 if (remoteClient.AgentId != taskItem.OwnerID) 1061 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
1059 return; 1062 {
1063 // If the item to be moved is no copy, we need to be able to
1064 // edit the prim.
1065 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
1066 return;
1067 }
1068 else
1069 {
1070 // If the item is copiable, then we just need to have perms
1071 // on it. The delete check is a pure rights check
1072 if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId))
1073 return;
1074 }
1060 1075
1061 MoveTaskInventoryItem(remoteClient, folderId, part, itemId); 1076 MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
1062 } 1077 }
@@ -1339,16 +1354,48 @@ namespace OpenSim.Region.Framework.Scenes
1339 { 1354 {
1340 agentTransactions.HandleTaskItemUpdateFromTransaction( 1355 agentTransactions.HandleTaskItemUpdateFromTransaction(
1341 remoteClient, part, transactionID, currentItem); 1356 remoteClient, part, transactionID, currentItem);
1342 } 1357
1343 if (part.Inventory.UpdateInventoryItem(itemInfo))
1344 {
1345 if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) 1358 if ((InventoryType)itemInfo.InvType == InventoryType.Notecard)
1346 remoteClient.SendAgentAlertMessage("Notecard saved", false); 1359 remoteClient.SendAgentAlertMessage("Notecard saved", false);
1347 else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) 1360 else if ((InventoryType)itemInfo.InvType == InventoryType.LSL)
1348 remoteClient.SendAgentAlertMessage("Script saved", false); 1361 remoteClient.SendAgentAlertMessage("Script saved", false);
1349 else 1362 else
1350 remoteClient.SendAgentAlertMessage("Item saved", false); 1363 remoteClient.SendAgentAlertMessage("Item saved", false);
1364 }
1365
1366 // Base ALWAYS has move
1367 currentItem.BasePermissions |= (uint)PermissionMask.Move;
1368
1369 // Check if we're allowed to mess with permissions
1370 if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
1371 {
1372 if (remoteClient.AgentId != part.OwnerID) // Not owner
1373 {
1374 // Friends and group members can't change any perms
1375 itemInfo.BasePermissions = currentItem.BasePermissions;
1376 itemInfo.EveryonePermissions = currentItem.EveryonePermissions;
1377 itemInfo.GroupPermissions = currentItem.GroupPermissions;
1378 itemInfo.NextPermissions = currentItem.NextPermissions;
1379 itemInfo.CurrentPermissions = currentItem.CurrentPermissions;
1380 }
1381 else
1382 {
1383 // Owner can't change base, and can change other
1384 // only up to base
1385 itemInfo.BasePermissions = currentItem.BasePermissions;
1386 itemInfo.EveryonePermissions &= currentItem.BasePermissions;
1387 itemInfo.GroupPermissions &= currentItem.BasePermissions;
1388 itemInfo.CurrentPermissions &= currentItem.BasePermissions;
1389 itemInfo.NextPermissions &= currentItem.BasePermissions;
1390 }
1391
1392 }
1351 1393
1394 // Next ALWAYS has move
1395 itemInfo.NextPermissions |= (uint)PermissionMask.Move;
1396
1397 if (part.Inventory.UpdateInventoryItem(itemInfo))
1398 {
1352 part.GetProperties(remoteClient); 1399 part.GetProperties(remoteClient);
1353 } 1400 }
1354 } 1401 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e2ab643..091fdeb 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -136,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
136 136
137 protected SceneCommunicationService m_sceneGridService; 137 protected SceneCommunicationService m_sceneGridService;
138 public bool LoginsDisabled = true; 138 public bool LoginsDisabled = true;
139 public bool LoadingPrims = false;
139 140
140 public new float TimeDilation 141 public new float TimeDilation
141 { 142 {
@@ -1879,6 +1880,7 @@ namespace OpenSim.Region.Framework.Scenes
1879 /// </summary> 1880 /// </summary>
1880 public virtual void LoadPrimsFromStorage(UUID regionID) 1881 public virtual void LoadPrimsFromStorage(UUID regionID)
1881 { 1882 {
1883 LoadingPrims = true;
1882 m_log.Info("[SCENE]: Loading objects from datastore"); 1884 m_log.Info("[SCENE]: Loading objects from datastore");
1883 1885
1884 List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); 1886 List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID);
@@ -1902,6 +1904,7 @@ namespace OpenSim.Region.Framework.Scenes
1902 } 1904 }
1903 1905
1904 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); 1906 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
1907 LoadingPrims = false;
1905 } 1908 }
1906 1909
1907 1910
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1ca390a..17275d0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -294,7 +294,7 @@ namespace OpenSim.Region.Framework.Scenes
294 294
295 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) 295 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
296 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) 296 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
297 && !IsAttachmentCheckFull()) 297 && !IsAttachmentCheckFull() && (!m_scene.LoadingPrims))
298 { 298 {
299 m_scene.CrossPrimGroupIntoNewRegion(val, this, true); 299 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
300 } 300 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 59fd805..6e29312 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4137,6 +4137,13 @@ namespace OpenSim.Region.Framework.Scenes
4137 case 16: 4137 case 16:
4138 _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) & 4138 _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) &
4139 baseMask; 4139 baseMask;
4140 // Prevent the client from creating no mod, no copy
4141 // objects
4142 if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0)
4143 _nextOwnerMask |= (uint)PermissionMask.Transfer;
4144
4145 _nextOwnerMask |= (uint)PermissionMask.Move;
4146
4140 break; 4147 break;
4141 } 4148 }
4142 SendFullUpdateToAllClients(); 4149 SendFullUpdateToAllClients();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 20d5486..9eb92be 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -598,7 +598,7 @@ namespace OpenSim.Region.Framework.Scenes
598 // changed since permissions were last set. 598 // changed since permissions were last set.
599 if (item.GroupPermissions != (uint)PermissionMask.None) 599 if (item.GroupPermissions != (uint)PermissionMask.None)
600 item.GroupID = m_part.GroupID; 600 item.GroupID = m_part.GroupID;
601 601
602 if (item.AssetID == UUID.Zero) 602 if (item.AssetID == UUID.Zero)
603 item.AssetID = it.AssetID; 603 item.AssetID = it.AssetID;
604 604