From d7a98925ce5693f28ef48e4228680f3a7aba12af Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 22 Sep 2008 12:52:56 +0000 Subject: Create CanEditObjectInventory to preserve the ability to have different permissions on inventory and object edits. This may be needed by the viewer on public grids --- .../Modules/World/Permissions/PermissionsModule.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 3b4819b..1a36315 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -163,6 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions m_scene.ExternalChecks.addCheckDuplicateObject(CanDuplicateObject); //FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckDeleteObject(CanDeleteObject); //MAYBE FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckEditObject(CanEditObject);//MAYBE FULLY IMPLEMENTED + m_scene.ExternalChecks.addCheckEditObject(CanEditObjectInventory);//MAYBE FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckEditParcel(CanEditParcel); //FULLY IMPLEMENTED m_scene.ExternalChecks.addCheckEditScript(CanEditScript); //NOT YET IMPLEMENTED m_scene.ExternalChecks.addCheckEditNotecard(CanEditNotecard); //NOT YET IMPLEMENTED @@ -602,6 +603,25 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return GenericObjectPermission(editorID, objectID, false); } + private bool CanEditObjectInventory(UUID objectID, UUID editorID, Scene scene) + { + DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); + if (m_bypassPermissions) return m_bypassPermissionsValue; + + SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); + + // Commented because this behavior causes issues for IBM + // With this commented, strange viewer issues can be observed + // when trying to edit scripts and/or notecards in + // "Hacked god mode" + // TODO: add group support! + // +// if(part.OwnerID != editorID) +// return false; + + return GenericObjectPermission(editorID, objectID, false); + } + private bool CanEditParcel(UUID user, ILandObject parcel, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); -- cgit v1.1