From fcaa4f601231a6feb7fd5ea40e35fba6220c6235 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Jul 2011 02:05:51 +0100 Subject: Revert "Don't load current/next/everyone/base permissions from the library item xml files - always use PermissionMask.All instead (which was the existing default)." There actually are uses for this. I will correct the perms instead since some entries appear to be wrong. This reverts commit 667b54f5a2a04fa5a2859397868d270eab3913f1. --- OpenSim/Framework/InventoryFolderImpl.cs | 8 +- .../InventoryAccess/InventoryAccessModule.cs | 4 - .../CoreModules/Framework/Library/LibraryModule.cs | 8 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 5 +- .../Services/InventoryService/LibraryService.cs | 37 ++- .../AnimationsLibrary/AnimationsLibraryItems.xml | 6 + .../BodyPartsLibrary/BodyPartsLibraryItems.xml | 33 ++- .../ClothingLibrary/ClothingLibraryItems.xml | 14 +- .../GesturesLibrary/GesturesLibraryItems.xml | 80 ++++-- .../LandmarksLibrary/LandmarksLibraryItems.xml | 4 + .../NotecardsLibrary/NotecardsLibraryItems.xml | 14 +- .../ObjectsLibrary/ObjectsLibraryItems.xml | 4 + bin/inventory/OpenSimLibrary/OpenSimLibrary.xml | 4 + bin/inventory/PhotosLibrary/PhotosLibraryItems.xml | 4 + .../ScriptsLibrary/ScriptsLibraryItems.xml | 223 ++++++++++++----- bin/inventory/SoundsLibrary/SoundsLibraryItems.xml | 4 + .../TexturesLibrary/TexturesLibraryItems.xml | 274 +++++++++++++++++---- 17 files changed, 567 insertions(+), 159 deletions(-) diff --git a/OpenSim/Framework/InventoryFolderImpl.cs b/OpenSim/Framework/InventoryFolderImpl.cs index 139776b..29c7682 100644 --- a/OpenSim/Framework/InventoryFolderImpl.cs +++ b/OpenSim/Framework/InventoryFolderImpl.cs @@ -27,15 +27,13 @@ using System; using System.Collections.Generic; -using System.Reflection; -using log4net; using OpenMetaverse; namespace OpenSim.Framework { public class InventoryFolderImpl : InventoryFolderBase { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly string PATH_DELIMITER = "/"; @@ -404,10 +402,6 @@ namespace OpenSim.Framework { foreach (InventoryItemBase item in Items.Values) { -// m_log.DebugFormat( -// "[INVENTORY FOLDER IMPL]: Returning item {0} {1}, OwnerPermissions {2:X}", -// item.Name, item.ID, item.CurrentPermissions); - itemList.Add(item); } } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 4933147..b714f2b 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -984,14 +984,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess public virtual bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID) { InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID); - if (assetRequestItem == null) { ILibraryService lib = m_Scene.RequestModuleInterface(); - if (lib != null) assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); - if (assetRequestItem == null) return false; } @@ -1022,7 +1019,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess m_log.WarnFormat( "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", Name, requestID, itemID, assetRequestItem.AssetID); - return false; } diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 2ef4457..d570608 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs @@ -185,7 +185,6 @@ namespace OpenSim.Region.CoreModules.Framework.Library archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName, false); archread.Execute(); } - foreach (InventoryNodeBase node in nodes) FixPerms(node); } @@ -198,23 +197,18 @@ namespace OpenSim.Region.CoreModules.Framework.Library archread.Close(); } } + } private void FixPerms(InventoryNodeBase node) { - m_log.DebugFormat("[LIBRARY MODULE]: Fixing perms for {0} {1}", node.Name, node.ID); - if (node is InventoryItemBase) { InventoryItemBase item = (InventoryItemBase)node; -// item.BasePermissions = (uint)PermissionMask.All; item.BasePermissions = 0x7FFFFFFF; item.EveryOnePermissions = 0x7FFFFFFF; item.CurrentPermissions = 0x7FFFFFFF; item.NextPermissions = 0x7FFFFFFF; -// item.EveryOnePermissions = (uint)PermissionMask.Copy; -// item.CurrentPermissions = (uint)PermissionMask.None; -// item.NextPermissions = (uint)PermissionMask.All; } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index afc1a4f..30421d4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -724,10 +724,7 @@ namespace OpenSim.Region.Framework.Scenes newName = item.Name; } - if (remoteClient.AgentId == oldAgentID - || (LibraryService != null - && LibraryService.LibraryRootFolder != null - && oldAgentID == LibraryService.LibraryRootFolder.Owner)) + if (remoteClient.AgentId == oldAgentID || (LibraryService != null && LibraryService.LibraryRootFolder != null && oldAgentID == LibraryService.LibraryRootFolder.Owner)) { CreateNewInventoryItem( remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index b46add3..383f311 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs @@ -93,6 +93,26 @@ namespace OpenSim.Services.InventoryService LoadLibraries(pLibrariesLocation); } + public InventoryItemBase CreateItem(UUID inventoryID, UUID assetID, string name, string description, + int assetType, int invType, UUID parentFolderID) + { + InventoryItemBase item = new InventoryItemBase(); + item.Owner = libOwner; + item.CreatorId = libOwner.ToString(); + item.ID = inventoryID; + item.AssetID = assetID; + item.Description = description; + item.Name = name; + item.AssetType = assetType; + item.InvType = invType; + item.Folder = parentFolderID; + item.BasePermissions = 0x7FFFFFFF; + item.EveryOnePermissions = 0x7FFFFFFF; + item.CurrentPermissions = 0x7FFFFFFF; + item.NextPermissions = 0x7FFFFFFF; + return item; + } + /// /// Use the asset set information at path to load assets /// @@ -173,27 +193,22 @@ namespace OpenSim.Services.InventoryService item.Description = config.GetString("description", item.Name); item.InvType = config.GetInt("inventoryType", 0); item.AssetType = config.GetInt("assetType", item.InvType); - item.CurrentPermissions = (uint)PermissionMask.All; - item.NextPermissions = (uint)PermissionMask.All; - item.EveryOnePermissions = (uint)PermissionMask.All; -// item.EveryOnePermissions = (uint)PermissionMask.All - (uint)PermissionMask.Modify; - item.BasePermissions = (uint)PermissionMask.All; + item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); + item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); + item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); + item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); + item.Flags = (uint)config.GetInt("flags", 0); if (libraryFolders.ContainsKey(item.Folder)) { InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; - try { -// m_log.DebugFormat( -// "[LIBRARY INVENTORY]: Adding item {0} {1}, OwnerPermissions {2:X} to {3}", -// item.Name, item.ID, item.CurrentPermissions, item.Folder); - parentFolder.Items.Add(item.ID, item); } catch (Exception) { - m_log.WarnFormat("[LIBRARY INVENTORY]: Item {1} [{0}] not added, duplicate item", item.ID, item.Name); + m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name); } } else diff --git a/bin/inventory/AnimationsLibrary/AnimationsLibraryItems.xml b/bin/inventory/AnimationsLibrary/AnimationsLibraryItems.xml index 9cfadf0..2a6ceb4 100644 --- a/bin/inventory/AnimationsLibrary/AnimationsLibraryItems.xml +++ b/bin/inventory/AnimationsLibrary/AnimationsLibraryItems.xml @@ -108,6 +108,8 @@ + + diff --git a/bin/inventory/BodyPartsLibrary/BodyPartsLibraryItems.xml b/bin/inventory/BodyPartsLibrary/BodyPartsLibraryItems.xml index d9adf1c..aa8d9d9 100644 --- a/bin/inventory/BodyPartsLibrary/BodyPartsLibraryItems.xml +++ b/bin/inventory/BodyPartsLibrary/BodyPartsLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> - diff --git a/bin/inventory/ClothingLibrary/ClothingLibraryItems.xml b/bin/inventory/ClothingLibrary/ClothingLibraryItems.xml index a12bb8a..9e297f0 100644 --- a/bin/inventory/ClothingLibrary/ClothingLibraryItems.xml +++ b/bin/inventory/ClothingLibrary/ClothingLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> - diff --git a/bin/inventory/GesturesLibrary/GesturesLibraryItems.xml b/bin/inventory/GesturesLibrary/GesturesLibraryItems.xml index ca3ce2d..1312129 100644 --- a/bin/inventory/GesturesLibrary/GesturesLibraryItems.xml +++ b/bin/inventory/GesturesLibrary/GesturesLibraryItems.xml @@ -7,8 +7,11 @@ + + + + -
@@ -17,8 +20,11 @@ + + + +
-
@@ -27,8 +33,11 @@ + + + +
-
@@ -37,8 +46,11 @@ + + + +
-
@@ -47,8 +59,11 @@ + + + +
-
@@ -57,8 +72,11 @@ + + + +
-
@@ -67,8 +85,11 @@ + + + +
-
@@ -77,8 +98,11 @@ + + + +
-
@@ -87,8 +111,11 @@ + + + +
-
@@ -97,8 +124,11 @@ + + + +
-
@@ -107,8 +137,11 @@ + + + +
-
@@ -117,8 +150,11 @@ + + + +
-
@@ -127,8 +163,11 @@ + + + +
-
@@ -137,8 +176,11 @@ + + + +
-
@@ -147,8 +189,11 @@ + + + +
-
@@ -157,6 +202,9 @@ + + + +
- diff --git a/bin/inventory/LandmarksLibrary/LandmarksLibraryItems.xml b/bin/inventory/LandmarksLibrary/LandmarksLibraryItems.xml index 44194cd..4047a58 100644 --- a/bin/inventory/LandmarksLibrary/LandmarksLibraryItems.xml +++ b/bin/inventory/LandmarksLibrary/LandmarksLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> diff --git a/bin/inventory/NotecardsLibrary/NotecardsLibraryItems.xml b/bin/inventory/NotecardsLibrary/NotecardsLibraryItems.xml index e232bcc..713c365 100644 --- a/bin/inventory/NotecardsLibrary/NotecardsLibraryItems.xml +++ b/bin/inventory/NotecardsLibrary/NotecardsLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> @@ -20,8 +24,11 @@ + + + + -
@@ -30,6 +37,9 @@ + + + +
- diff --git a/bin/inventory/ObjectsLibrary/ObjectsLibraryItems.xml b/bin/inventory/ObjectsLibrary/ObjectsLibraryItems.xml index 44194cd..4047a58 100644 --- a/bin/inventory/ObjectsLibrary/ObjectsLibraryItems.xml +++ b/bin/inventory/ObjectsLibrary/ObjectsLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> diff --git a/bin/inventory/OpenSimLibrary/OpenSimLibrary.xml b/bin/inventory/OpenSimLibrary/OpenSimLibrary.xml index bef59d8..7eb8de3 100644 --- a/bin/inventory/OpenSimLibrary/OpenSimLibrary.xml +++ b/bin/inventory/OpenSimLibrary/OpenSimLibrary.xml @@ -10,6 +10,10 @@ + + + + --> diff --git a/bin/inventory/PhotosLibrary/PhotosLibraryItems.xml b/bin/inventory/PhotosLibrary/PhotosLibraryItems.xml index 44194cd..4047a58 100644 --- a/bin/inventory/PhotosLibrary/PhotosLibraryItems.xml +++ b/bin/inventory/PhotosLibrary/PhotosLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> diff --git a/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml b/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml index df9d867..9641f7d 100644 --- a/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml +++ b/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml @@ -25,8 +25,11 @@ + + + + -
@@ -35,8 +38,11 @@ + + + +
-
@@ -45,8 +51,11 @@ + + + +
-
@@ -55,8 +64,11 @@ + + + +
-
@@ -65,8 +77,11 @@ + + + +
-
@@ -75,8 +90,11 @@ + + + +
-
@@ -85,8 +103,11 @@ + + + +
-
@@ -95,8 +116,11 @@ + + + +
-
@@ -105,8 +129,11 @@ + + + +
-
@@ -115,8 +142,11 @@ + + + +
-
@@ -125,8 +155,11 @@ + + + +
-
@@ -136,8 +169,11 @@ + + + +
- @@ -151,7 +187,6 @@ -
@@ -160,8 +195,11 @@ + + + +
-
@@ -170,8 +208,11 @@ + + + +
-
@@ -180,8 +221,11 @@ + + + +
-
@@ -190,8 +234,11 @@ + + + +
-
@@ -201,8 +248,11 @@ + + + +
-
@@ -211,8 +261,11 @@ + + + +
-
@@ -221,8 +274,11 @@ + + + +
- @@ -232,166 +288,213 @@
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
-
- + + + + +
- -
@@ -400,8 +503,11 @@ + + + +
-
@@ -410,8 +516,11 @@ + + + +
-
@@ -420,5 +529,9 @@ + + + +
diff --git a/bin/inventory/SoundsLibrary/SoundsLibraryItems.xml b/bin/inventory/SoundsLibrary/SoundsLibraryItems.xml index 44194cd..4047a58 100644 --- a/bin/inventory/SoundsLibrary/SoundsLibraryItems.xml +++ b/bin/inventory/SoundsLibrary/SoundsLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> diff --git a/bin/inventory/TexturesLibrary/TexturesLibraryItems.xml b/bin/inventory/TexturesLibrary/TexturesLibraryItems.xml index a018a0d..adba99a 100644 --- a/bin/inventory/TexturesLibrary/TexturesLibraryItems.xml +++ b/bin/inventory/TexturesLibrary/TexturesLibraryItems.xml @@ -9,6 +9,10 @@ + + + + --> @@ -20,8 +24,11 @@ + + + + -
@@ -30,8 +37,11 @@ + + + +
-
@@ -40,8 +50,11 @@ + + + +
-
@@ -50,8 +63,11 @@ + + + +
-
@@ -60,8 +76,11 @@ + + + +
-
@@ -70,8 +89,11 @@ + + + +
-
@@ -80,8 +102,11 @@ + + + +
-
@@ -90,8 +115,11 @@ + + + +
-
@@ -100,8 +128,11 @@ + + + +
-
@@ -110,8 +141,11 @@ + + + +
-
@@ -120,8 +154,11 @@ + + + +
-
@@ -130,8 +167,11 @@ + + + +
-
@@ -140,8 +180,11 @@ + + + +
-
@@ -150,8 +193,11 @@ + + + +
-
@@ -160,8 +206,11 @@ + + + +
-
@@ -170,8 +219,11 @@ + + + +
-
@@ -180,8 +232,11 @@ + + + +
-
@@ -190,8 +245,11 @@ + + + +
-
@@ -200,8 +258,11 @@ + + + +
-
@@ -210,8 +271,11 @@ + + + +
-
@@ -220,8 +284,11 @@ + + + +
-
@@ -230,8 +297,11 @@ + + + +
-
@@ -240,8 +310,11 @@ + + + +
-
@@ -250,8 +323,11 @@ + + + +
-
@@ -260,8 +336,11 @@ + + + +
-
@@ -270,8 +349,11 @@ + + + +
-
@@ -280,8 +362,11 @@ + + + +
-
@@ -290,8 +375,11 @@ + + + +
-
@@ -300,8 +388,11 @@ + + + +
-
@@ -310,8 +401,11 @@ + + + +
-
@@ -320,8 +414,11 @@ + + + +
-
@@ -330,8 +427,11 @@ + + + +
-
@@ -340,8 +440,11 @@ + + + +
-
@@ -350,8 +453,11 @@ + + + +
-
@@ -360,8 +466,11 @@ + + + +
-
@@ -370,8 +479,11 @@ + + + +
-
@@ -380,8 +492,11 @@ + + + +
-
@@ -390,8 +505,11 @@ + + + +
-
@@ -400,8 +518,11 @@ + + + +
-
@@ -410,8 +531,11 @@ + + + +
-
@@ -420,8 +544,11 @@ + + + +
-
@@ -430,8 +557,11 @@ + + + +
-
@@ -440,8 +570,11 @@ + + + +
-
@@ -450,8 +583,11 @@ + + + +
-
@@ -460,8 +596,11 @@ + + + +
-
@@ -470,8 +609,11 @@ + + + +
-
@@ -480,8 +622,11 @@ + + + +
-
@@ -490,6 +635,10 @@ + + + +
@@ -500,8 +649,11 @@ + + + +
-
@@ -510,8 +662,11 @@ + + + +
-
@@ -520,8 +675,11 @@ + + + +
-
@@ -530,6 +688,10 @@ + + + +
@@ -540,6 +702,10 @@ + + + +
@@ -550,6 +716,10 @@ + + + +
@@ -560,5 +730,9 @@ + + + +
-- cgit v1.1