aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2010-03-18 19:58:21 +0000
committerMelanie2010-03-18 19:58:21 +0000
commite0289bb43231a72055a16902af3d1ae49a44771e (patch)
treeb1d7c6a39d06832dbff510ceeeed5d0a0951d695 /OpenSim/Region
parentUnify a previous refactor of object return with the older solution. We (diff)
downloadopensim-SC-e0289bb43231a72055a16902af3d1ae49a44771e.zip
opensim-SC-e0289bb43231a72055a16902af3d1ae49a44771e.tar.gz
opensim-SC-e0289bb43231a72055a16902af3d1ae49a44771e.tar.bz2
opensim-SC-e0289bb43231a72055a16902af3d1ae49a44771e.tar.xz
Flesh out the new permission method
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs99
1 files changed, 95 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 38fc250..4dbdb01 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1276,13 +1276,104 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1276 1276
1277 private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene) 1277 private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene)
1278 { 1278 {
1279 if (objects.Count == 0)
1280 return false;
1281
1282 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1279 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1283 if (m_bypassPermissions) return m_bypassPermissionsValue; 1280 if (m_bypassPermissions) return m_bypassPermissionsValue;
1284 1281
1285 return GenericObjectPermission(user, objects[0].UUID, false); 1282 GroupPowers powers;
1283 ILandObject l;
1284
1285 ScenePresence sp = scene.GetScenePresence(user);
1286 if (sp == null)
1287 return false;
1288
1289 IClientAPI client = sp.ControllingClient;
1290
1291 foreach (SceneObjectGroup g in new List<SceneObjectGroup>(objects))
1292 {
1293 // Any user can return their own objects at any time
1294 //
1295 if (GenericObjectPermission(user, g.UUID, false))
1296 continue;
1297
1298 // This is a short cut for efficiency. If land is non-null,
1299 // then all objects are on that parcel and we can save
1300 // ourselves the checking for each prim. Much faster.
1301 //
1302 if (land != null)
1303 {
1304 l = land;
1305 }
1306 else
1307 {
1308 Vector3 pos = g.AbsolutePosition;
1309
1310 l = scene.LandChannel.GetLandObject(pos.X, pos.Y);
1311 }
1312
1313 // If it's not over any land, then we can't do a thing
1314 if (l == null)
1315 {
1316 objects.Remove(g);
1317 continue;
1318 }
1319
1320 // If we own the land outright, then allow
1321 //
1322 if (l.LandData.OwnerID == user)
1323 continue;
1324
1325 // Group voodoo
1326 //
1327 if (land.LandData.IsGroupOwned)
1328 {
1329 powers = (GroupPowers)client.GetGroupPowers(land.LandData.GroupID);
1330 // Not a group member, or no rights at all
1331 //
1332 if (powers == (GroupPowers)0)
1333 {
1334 objects.Remove(g);
1335 continue;
1336 }
1337
1338 // Group deeded object?
1339 //
1340 if (g.OwnerID == l.LandData.GroupID &&
1341 (powers & GroupPowers.ReturnGroupOwned) == (GroupPowers)0)
1342 {
1343 objects.Remove(g);
1344 continue;
1345 }
1346
1347 // Group set object?
1348 //
1349 if (g.GroupID == l.LandData.GroupID &&
1350 (powers & GroupPowers.ReturnGroupSet) == (GroupPowers)0)
1351 {
1352 objects.Remove(g);
1353 continue;
1354 }
1355
1356 if ((powers & GroupPowers.ReturnNonGroup) == (GroupPowers)0)
1357 {
1358 objects.Remove(g);
1359 continue;
1360 }
1361
1362 // So we can remove all objects from this group land.
1363 // Fine.
1364 //
1365 continue;
1366 }
1367
1368 // By default, we can't remove
1369 //
1370 objects.Remove(g);
1371 }
1372
1373 if (objects.Count == 0)
1374 return false;
1375
1376 return true;
1286 } 1377 }
1287 1378
1288 private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene) 1379 private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene)