aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService/LibraryService.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-23 01:59:14 +0100
committerJustin Clark-Casey (justincc)2011-07-23 01:59:14 +0100
commit667b54f5a2a04fa5a2859397868d270eab3913f1 (patch)
treebf91543d5c0c4aa6f1a25873be6acb86144675bc /OpenSim/Services/InventoryService/LibraryService.cs
parentFix problem where sculpts were not getting physical proxies (diff)
downloadopensim-SC-667b54f5a2a04fa5a2859397868d270eab3913f1.zip
opensim-SC-667b54f5a2a04fa5a2859397868d270eab3913f1.tar.gz
opensim-SC-667b54f5a2a04fa5a2859397868d270eab3913f1.tar.bz2
opensim-SC-667b54f5a2a04fa5a2859397868d270eab3913f1.tar.xz
Don't load current/next/everyone/base permissions from the library item xml files - always use PermissionMask.All instead (which was the existing default).
Library items always need the same permissions, so it doesn't make sense to load them from the xml files. This just opens the door to permissions mistakes.
Diffstat (limited to 'OpenSim/Services/InventoryService/LibraryService.cs')
-rw-r--r--OpenSim/Services/InventoryService/LibraryService.cs37
1 files changed, 11 insertions, 26 deletions
diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs
index 383f311..b46add3 100644
--- a/OpenSim/Services/InventoryService/LibraryService.cs
+++ b/OpenSim/Services/InventoryService/LibraryService.cs
@@ -93,26 +93,6 @@ 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
116 /// <summary> 96 /// <summary>
117 /// Use the asset set information at path to load assets 97 /// Use the asset set information at path to load assets
118 /// </summary> 98 /// </summary>
@@ -193,22 +173,27 @@ namespace OpenSim.Services.InventoryService
193 item.Description = config.GetString("description", item.Name); 173 item.Description = config.GetString("description", item.Name);
194 item.InvType = config.GetInt("inventoryType", 0); 174 item.InvType = config.GetInt("inventoryType", 0);
195 item.AssetType = config.GetInt("assetType", item.InvType); 175 item.AssetType = config.GetInt("assetType", item.InvType);
196 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); 176 item.CurrentPermissions = (uint)PermissionMask.All;
197 item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); 177 item.NextPermissions = (uint)PermissionMask.All;
198 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); 178 item.EveryOnePermissions = (uint)PermissionMask.All;
199 item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); 179// item.EveryOnePermissions = (uint)PermissionMask.All - (uint)PermissionMask.Modify;
200 item.Flags = (uint)config.GetInt("flags", 0); 180 item.BasePermissions = (uint)PermissionMask.All;
201 181
202 if (libraryFolders.ContainsKey(item.Folder)) 182 if (libraryFolders.ContainsKey(item.Folder))
203 { 183 {
204 InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; 184 InventoryFolderImpl parentFolder = libraryFolders[item.Folder];
185
205 try 186 try
206 { 187 {
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
207 parentFolder.Items.Add(item.ID, item); 192 parentFolder.Items.Add(item.ID, item);
208 } 193 }
209 catch (Exception) 194 catch (Exception)
210 { 195 {
211 m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name); 196 m_log.WarnFormat("[LIBRARY INVENTORY]: Item {1} [{0}] not added, duplicate item", item.ID, item.Name);
212 } 197 }
213 } 198 }
214 else 199 else