From dfda3dd4d7d14af6c86bc09765f0976bfc6b18c1 Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Fri, 18 Jan 2008 14:01:41 +0000
Subject: * Fixed bug where 'taskOwnerId' would always be null in
PermissionManager, hence always retuning false on GenericObjectPermission.
---
OpenSim/Region/Environment/PermissionManager.cs | 32 ++++++++++++++--------
.../Region/Environment/Scenes/SceneObjectPart.cs | 7 +----
2 files changed, 21 insertions(+), 18 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index f72ae66..9640ed7 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment
return objectEveryoneMask;
}
- protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId)
+ protected virtual bool GenericObjectPermission(LLUUID currentUser, LLUUID objId)
{
// Default: deny
bool permission = false;
@@ -256,32 +256,40 @@ namespace OpenSim.Region.Environment
return false;
}
- SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[objId];
- LLUUID taskOwner = null;
- // Added this because at this point in time it wouldn't be wise for
- // the administrator object permissions to take effect.
- LLUUID objectOwner = task.OwnerID;
+ SceneObjectGroup group = (SceneObjectGroup) m_scene.Entities[objId];
+
+ LLUUID objectOwner = group.OwnerID;
// Object owners should be able to edit their own content
- if (user == objectOwner)
+ if (currentUser == objectOwner)
+ {
permission = true;
+ }
// Users should be able to edit what is over their land.
- Land parcel = m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y);
- if (parcel != null && parcel.landData.ownerID == user)
+ Land parcel = m_scene.LandManager.getLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y);
+ if ((parcel != null) && ( parcel.landData.ownerID == currentUser))
+ {
permission = true;
+ }
// Estate users should be able to edit anything in the sim
- if (IsEstateManager(user))
+ if (IsEstateManager(currentUser))
+ {
permission = true;
+ }
// Admin objects should not be editable by the above
- if (IsAdministrator(taskOwner))
+ if (IsAdministrator(objectOwner))
+ {
permission = false;
+ }
// Admin should be able to edit anything in the sim (including admin objects)
- if (IsAdministrator(user))
+ if (IsAdministrator(currentUser))
+ {
permission = true;
+ }
return permission;
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index ce38bee..20e761f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1572,12 +1572,7 @@ namespace OpenSim.Region.Environment.Scenes
lPos = OffsetPosition;
SendFullUpdateToClient(remoteClient, lPos, clientflags);
}
-
- ///
- ///
- ///
- ///
- ///
+
public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags)
{
LLQuaternion lRot;
--
cgit v1.1