aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-23 02:05:51 +0100
committerJustin Clark-Casey (justincc)2011-07-23 02:05:51 +0100
commitfcaa4f601231a6feb7fd5ea40e35fba6220c6235 (patch)
tree003517e08cd61bccc1263ab992d09c576aa25ab4 /OpenSim
parentDon't load current/next/everyone/base permissions from the library item xml f... (diff)
downloadopensim-SC_OLD-fcaa4f601231a6feb7fd5ea40e35fba6220c6235.zip
opensim-SC_OLD-fcaa4f601231a6feb7fd5ea40e35fba6220c6235.tar.gz
opensim-SC_OLD-fcaa4f601231a6feb7fd5ea40e35fba6220c6235.tar.bz2
opensim-SC_OLD-fcaa4f601231a6feb7fd5ea40e35fba6220c6235.tar.xz
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.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/InventoryFolderImpl.cs8
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs5
-rw-r--r--OpenSim/Services/InventoryService/LibraryService.cs37
5 files changed, 29 insertions, 33 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 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using OpenMetaverse; 30using OpenMetaverse;
33 31
34namespace OpenSim.Framework 32namespace OpenSim.Framework
35{ 33{
36 public class InventoryFolderImpl : InventoryFolderBase 34 public class InventoryFolderImpl : InventoryFolderBase
37 { 35 {
38// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 36 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
39 37
40 public static readonly string PATH_DELIMITER = "/"; 38 public static readonly string PATH_DELIMITER = "/";
41 39
@@ -404,10 +402,6 @@ namespace OpenSim.Framework
404 { 402 {
405 foreach (InventoryItemBase item in Items.Values) 403 foreach (InventoryItemBase item in Items.Values)
406 { 404 {
407// m_log.DebugFormat(
408// "[INVENTORY FOLDER IMPL]: Returning item {0} {1}, OwnerPermissions {2:X}",
409// item.Name, item.ID, item.CurrentPermissions);
410
411 itemList.Add(item); 405 itemList.Add(item);
412 } 406 }
413 } 407 }
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
984 public virtual bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID) 984 public virtual bool CanGetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
985 { 985 {
986 InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID); 986 InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
987
988 if (assetRequestItem == null) 987 if (assetRequestItem == null)
989 { 988 {
990 ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>(); 989 ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>();
991
992 if (lib != null) 990 if (lib != null)
993 assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); 991 assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
994
995 if (assetRequestItem == null) 992 if (assetRequestItem == null)
996 return false; 993 return false;
997 } 994 }
@@ -1022,7 +1019,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1022 m_log.WarnFormat( 1019 m_log.WarnFormat(
1023 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", 1020 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
1024 Name, requestID, itemID, assetRequestItem.AssetID); 1021 Name, requestID, itemID, assetRequestItem.AssetID);
1025
1026 return false; 1022 return false;
1027 } 1023 }
1028 1024
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
185 archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName, false); 185 archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName, false);
186 archread.Execute(); 186 archread.Execute();
187 } 187 }
188
189 foreach (InventoryNodeBase node in nodes) 188 foreach (InventoryNodeBase node in nodes)
190 FixPerms(node); 189 FixPerms(node);
191 } 190 }
@@ -198,23 +197,18 @@ namespace OpenSim.Region.CoreModules.Framework.Library
198 archread.Close(); 197 archread.Close();
199 } 198 }
200 } 199 }
200
201 } 201 }
202 202
203 private void FixPerms(InventoryNodeBase node) 203 private void FixPerms(InventoryNodeBase node)
204 { 204 {
205 m_log.DebugFormat("[LIBRARY MODULE]: Fixing perms for {0} {1}", node.Name, node.ID);
206
207 if (node is InventoryItemBase) 205 if (node is InventoryItemBase)
208 { 206 {
209 InventoryItemBase item = (InventoryItemBase)node; 207 InventoryItemBase item = (InventoryItemBase)node;
210// item.BasePermissions = (uint)PermissionMask.All;
211 item.BasePermissions = 0x7FFFFFFF; 208 item.BasePermissions = 0x7FFFFFFF;
212 item.EveryOnePermissions = 0x7FFFFFFF; 209 item.EveryOnePermissions = 0x7FFFFFFF;
213 item.CurrentPermissions = 0x7FFFFFFF; 210 item.CurrentPermissions = 0x7FFFFFFF;
214 item.NextPermissions = 0x7FFFFFFF; 211 item.NextPermissions = 0x7FFFFFFF;
215// item.EveryOnePermissions = (uint)PermissionMask.Copy;
216// item.CurrentPermissions = (uint)PermissionMask.None;
217// item.NextPermissions = (uint)PermissionMask.All;
218 } 212 }
219 } 213 }
220 214
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
724 newName = item.Name; 724 newName = item.Name;
725 } 725 }
726 726
727 if (remoteClient.AgentId == oldAgentID 727 if (remoteClient.AgentId == oldAgentID || (LibraryService != null && LibraryService.LibraryRootFolder != null && oldAgentID == LibraryService.LibraryRootFolder.Owner))
728 || (LibraryService != null
729 && LibraryService.LibraryRootFolder != null
730 && oldAgentID == LibraryService.LibraryRootFolder.Owner))
731 { 728 {
732 CreateNewInventoryItem( 729 CreateNewInventoryItem(
733 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, 730 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
93 LoadLibraries(pLibrariesLocation); 93 LoadLibraries(pLibrariesLocation);
94 } 94 }
95 95
96 public InventoryItemBase CreateItem(UUID inventoryID, UUID assetID, string name, string description,
97 int assetType, int invType, UUID parentFolderID)
98 {
99 InventoryItemBase item = new InventoryItemBase();
100 item.Owner = libOwner;
101 item.CreatorId = libOwner.ToString();
102 item.ID = inventoryID;
103 item.AssetID = assetID;
104 item.Description = description;
105 item.Name = name;
106 item.AssetType = assetType;
107 item.InvType = invType;
108 item.Folder = parentFolderID;
109 item.BasePermissions = 0x7FFFFFFF;
110 item.EveryOnePermissions = 0x7FFFFFFF;
111 item.CurrentPermissions = 0x7FFFFFFF;
112 item.NextPermissions = 0x7FFFFFFF;
113 return item;
114 }
115
96 /// <summary> 116 /// <summary>
97 /// Use the asset set information at path to load assets 117 /// Use the asset set information at path to load assets
98 /// </summary> 118 /// </summary>
@@ -173,27 +193,22 @@ namespace OpenSim.Services.InventoryService
173 item.Description = config.GetString("description", item.Name); 193 item.Description = config.GetString("description", item.Name);
174 item.InvType = config.GetInt("inventoryType", 0); 194 item.InvType = config.GetInt("inventoryType", 0);
175 item.AssetType = config.GetInt("assetType", item.InvType); 195 item.AssetType = config.GetInt("assetType", item.InvType);
176 item.CurrentPermissions = (uint)PermissionMask.All; 196 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF);
177 item.NextPermissions = (uint)PermissionMask.All; 197 item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
178 item.EveryOnePermissions = (uint)PermissionMask.All; 198 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
179// item.EveryOnePermissions = (uint)PermissionMask.All - (uint)PermissionMask.Modify; 199 item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
180 item.BasePermissions = (uint)PermissionMask.All; 200 item.Flags = (uint)config.GetInt("flags", 0);
181 201
182 if (libraryFolders.ContainsKey(item.Folder)) 202 if (libraryFolders.ContainsKey(item.Folder))
183 { 203 {
184 InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; 204 InventoryFolderImpl parentFolder = libraryFolders[item.Folder];
185
186 try 205 try
187 { 206 {
188// m_log.DebugFormat(
189// "[LIBRARY INVENTORY]: Adding item {0} {1}, OwnerPermissions {2:X} to {3}",
190// item.Name, item.ID, item.CurrentPermissions, item.Folder);
191
192 parentFolder.Items.Add(item.ID, item); 207 parentFolder.Items.Add(item.ID, item);
193 } 208 }
194 catch (Exception) 209 catch (Exception)
195 { 210 {
196 m_log.WarnFormat("[LIBRARY INVENTORY]: Item {1} [{0}] not added, duplicate item", item.ID, item.Name); 211 m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name);
197 } 212 }
198 } 213 }
199 else 214 else