aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-01-22 03:23:50 +0000
committerUbitUmarov2017-01-22 03:23:50 +0000
commit50e318c401f69b7b3946b0a630d455bf7fe4118c (patch)
treefcdf94348e955ee39325a97ff05bb067a0d5ecdd /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parenta few more changes on permissions (diff)
downloadopensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.zip
opensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.tar.gz
opensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.tar.bz2
opensim-SC-50e318c401f69b7b3946b0a630d455bf7fe4118c.tar.xz
work around group sharing and owned permitions issues, fix a non copy objects delete issue
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs33
1 files changed, 12 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3230a2b..a1eb721 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1380,18 +1380,10 @@ namespace OpenSim.Region.Framework.Scenes
1380 return; 1380 return;
1381 } 1381 }
1382 1382
1383 if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 1383 if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId))
1384 { 1384 {
1385 // If the item to be moved is no copy, we need to be able to 1385 // check also if we can delete the no copy item
1386 // edit the prim. 1386 if(!Permissions.CanEditObject(part.UUID, remoteClient.AgentId))
1387 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
1388 return;
1389 }
1390 else
1391 {
1392 // If the item is copiable, then we just need to have perms
1393 // on it. The delete check is a pure rights check
1394 if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId))
1395 return; 1387 return;
1396 } 1388 }
1397 1389
@@ -2125,6 +2117,7 @@ namespace OpenSim.Region.Framework.Scenes
2125 List<uint> deleteIDs = new List<uint>(); 2117 List<uint> deleteIDs = new List<uint>();
2126 List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); 2118 List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>();
2127 List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); 2119 List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>();
2120 List<SceneObjectGroup> takeDeleteGroups = new List<SceneObjectGroup>();
2128 2121
2129 ScenePresence sp = remoteClient.SceneAgent as ScenePresence; 2122 ScenePresence sp = remoteClient.SceneAgent as ScenePresence;
2130 2123
@@ -2192,7 +2185,7 @@ namespace OpenSim.Region.Framework.Scenes
2192 if (!Permissions.CanTakeObject(grp, sp)) 2185 if (!Permissions.CanTakeObject(grp, sp))
2193 permissionToTake = false; 2186 permissionToTake = false;
2194 2187
2195 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) 2188 if (!Permissions.CanDeleteObject(grp, remoteClient))
2196 permissionToDelete = false; 2189 permissionToDelete = false;
2197 } 2190 }
2198 2191
@@ -2249,26 +2242,24 @@ namespace OpenSim.Region.Framework.Scenes
2249 } 2242 }
2250 } 2243 }
2251 2244
2252 if (permissionToTake && (!permissionToDelete))
2253 takeGroups.Add(grp);
2254
2255 if (permissionToDelete) 2245 if (permissionToDelete)
2256 { 2246 {
2257 if (permissionToTake) 2247 if (permissionToTake)
2248 takeDeleteGroups.Add(grp);
2249 else
2258 deleteGroups.Add(grp); 2250 deleteGroups.Add(grp);
2259 deleteIDs.Add(grp.LocalId); 2251 deleteIDs.Add(grp.LocalId);
2260 } 2252 }
2253 else if(permissionToTake)
2254 takeGroups.Add(grp);
2261 } 2255 }
2262 2256
2263 SendKillObject(deleteIDs); 2257 SendKillObject(deleteIDs);
2264 2258
2265 if (deleteGroups.Count > 0) 2259 if (takeDeleteGroups.Count > 0)
2266 { 2260 {
2267 foreach (SceneObjectGroup g in deleteGroups)
2268 deleteIDs.Remove(g.LocalId);
2269
2270 m_asyncSceneObjectDeleter.DeleteToInventory( 2261 m_asyncSceneObjectDeleter.DeleteToInventory(
2271 action, destinationID, deleteGroups, remoteClient, 2262 action, destinationID, takeDeleteGroups, remoteClient,
2272 true); 2263 true);
2273 } 2264 }
2274 if (takeGroups.Count > 0) 2265 if (takeGroups.Count > 0)
@@ -2277,7 +2268,7 @@ namespace OpenSim.Region.Framework.Scenes
2277 action, destinationID, takeGroups, remoteClient, 2268 action, destinationID, takeGroups, remoteClient,
2278 false); 2269 false);
2279 } 2270 }
2280 if (deleteIDs.Count > 0) 2271 if (deleteGroups.Count > 0)
2281 { 2272 {
2282 foreach (SceneObjectGroup g in deleteGroups) 2273 foreach (SceneObjectGroup g in deleteGroups)
2283 DeleteSceneObject(g, true); 2274 DeleteSceneObject(g, true);