aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-23 02:13:11 +0100
committerJustin Clark-Casey (justincc)2011-07-23 02:13:11 +0100
commitf0895028e96e39ca179cad8c103042397ad870e5 (patch)
tree07a381bc2eac55c04e2776b8d92757881a27ccfc /OpenSim
parentRevert "Don't load current/next/everyone/base permissions from the library it... (diff)
downloadopensim-SC_OLD-f0895028e96e39ca179cad8c103042397ad870e5.zip
opensim-SC_OLD-f0895028e96e39ca179cad8c103042397ad870e5.tar.gz
opensim-SC_OLD-f0895028e96e39ca179cad8c103042397ad870e5.tar.bz2
opensim-SC_OLD-f0895028e96e39ca179cad8c103042397ad870e5.tar.xz
Remove manually permissions settings on all current library items so that they use the defaults instead.
Some items had completely wrong permissions - this is easier than correcting them all. The ability to set permissions in xml is retained since there are use cases for this (e.g. to create no-mod library scripts)
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.cs8
5 files changed, 26 insertions, 7 deletions
diff --git a/OpenSim/Framework/InventoryFolderImpl.cs b/OpenSim/Framework/InventoryFolderImpl.cs
index 29c7682..139776b 100644
--- a/OpenSim/Framework/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/InventoryFolderImpl.cs
@@ -27,13 +27,15 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
30using OpenMetaverse; 32using OpenMetaverse;
31 33
32namespace OpenSim.Framework 34namespace OpenSim.Framework
33{ 35{
34 public class InventoryFolderImpl : InventoryFolderBase 36 public class InventoryFolderImpl : InventoryFolderBase
35 { 37 {
36 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 38// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
37 39
38 public static readonly string PATH_DELIMITER = "/"; 40 public static readonly string PATH_DELIMITER = "/";
39 41
@@ -402,6 +404,10 @@ namespace OpenSim.Framework
402 { 404 {
403 foreach (InventoryItemBase item in Items.Values) 405 foreach (InventoryItemBase item in Items.Values)
404 { 406 {
407// m_log.DebugFormat(
408// "[INVENTORY FOLDER IMPL]: Returning item {0} {1}, OwnerPermissions {2:X}",
409// item.Name, item.ID, item.CurrentPermissions);
410
405 itemList.Add(item); 411 itemList.Add(item);
406 } 412 }
407 } 413 }
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index b714f2b..4933147 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -984,11 +984,14 @@ 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
987 if (assetRequestItem == null) 988 if (assetRequestItem == null)
988 { 989 {
989 ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>(); 990 ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>();
991
990 if (lib != null) 992 if (lib != null)
991 assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); 993 assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
994
992 if (assetRequestItem == null) 995 if (assetRequestItem == null)
993 return false; 996 return false;
994 } 997 }
@@ -1019,6 +1022,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
1019 m_log.WarnFormat( 1022 m_log.WarnFormat(
1020 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", 1023 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
1021 Name, requestID, itemID, assetRequestItem.AssetID); 1024 Name, requestID, itemID, assetRequestItem.AssetID);
1025
1022 return false; 1026 return false;
1023 } 1027 }
1024 1028
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
index d570608..2ef4457 100644
--- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs
@@ -185,6 +185,7 @@ 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
188 foreach (InventoryNodeBase node in nodes) 189 foreach (InventoryNodeBase node in nodes)
189 FixPerms(node); 190 FixPerms(node);
190 } 191 }
@@ -197,18 +198,23 @@ namespace OpenSim.Region.CoreModules.Framework.Library
197 archread.Close(); 198 archread.Close();
198 } 199 }
199 } 200 }
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
205 if (node is InventoryItemBase) 207 if (node is InventoryItemBase)
206 { 208 {
207 InventoryItemBase item = (InventoryItemBase)node; 209 InventoryItemBase item = (InventoryItemBase)node;
210// item.BasePermissions = (uint)PermissionMask.All;
208 item.BasePermissions = 0x7FFFFFFF; 211 item.BasePermissions = 0x7FFFFFFF;
209 item.EveryOnePermissions = 0x7FFFFFFF; 212 item.EveryOnePermissions = 0x7FFFFFFF;
210 item.CurrentPermissions = 0x7FFFFFFF; 213 item.CurrentPermissions = 0x7FFFFFFF;
211 item.NextPermissions = 0x7FFFFFFF; 214 item.NextPermissions = 0x7FFFFFFF;
215// item.EveryOnePermissions = (uint)PermissionMask.Copy;
216// item.CurrentPermissions = (uint)PermissionMask.None;
217// item.NextPermissions = (uint)PermissionMask.All;
212 } 218 }
213 } 219 }
214 220
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 30421d4..afc1a4f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -724,7 +724,10 @@ namespace OpenSim.Region.Framework.Scenes
724 newName = item.Name; 724 newName = item.Name;
725 } 725 }
726 726
727 if (remoteClient.AgentId == oldAgentID || (LibraryService != null && LibraryService.LibraryRootFolder != null && oldAgentID == LibraryService.LibraryRootFolder.Owner)) 727 if (remoteClient.AgentId == oldAgentID
728 || (LibraryService != null
729 && LibraryService.LibraryRootFolder != null
730 && oldAgentID == LibraryService.LibraryRootFolder.Owner))
728 { 731 {
729 CreateNewInventoryItem( 732 CreateNewInventoryItem(
730 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, 733 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 383f311..2e9d2b1 100644
--- a/OpenSim/Services/InventoryService/LibraryService.cs
+++ b/OpenSim/Services/InventoryService/LibraryService.cs
@@ -193,10 +193,10 @@ namespace OpenSim.Services.InventoryService
193 item.Description = config.GetString("description", item.Name); 193 item.Description = config.GetString("description", item.Name);
194 item.InvType = config.GetInt("inventoryType", 0); 194 item.InvType = config.GetInt("inventoryType", 0);
195 item.AssetType = config.GetInt("assetType", item.InvType); 195 item.AssetType = config.GetInt("assetType", item.InvType);
196 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); 196 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", (uint)PermissionMask.All);
197 item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); 197 item.NextPermissions = (uint)config.GetLong("nextPermissions", (uint)PermissionMask.All);
198 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); 198 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All);
199 item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); 199 item.BasePermissions = (uint)config.GetLong("basePermissions", (uint)PermissionMask.All);
200 item.Flags = (uint)config.GetInt("flags", 0); 200 item.Flags = (uint)config.GetInt("flags", 0);
201 201
202 if (libraryFolders.ContainsKey(item.Folder)) 202 if (libraryFolders.ContainsKey(item.Folder))