aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/InventoryService/LibraryService.cs32
1 files changed, 19 insertions, 13 deletions
diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs
index c71295d..de1c784 100644
--- a/OpenSim/Services/InventoryService/LibraryService.cs
+++ b/OpenSim/Services/InventoryService/LibraryService.cs
@@ -69,6 +69,11 @@ namespace OpenSim.Services.InventoryService
69 static protected Dictionary<UUID, InventoryItemBase> m_items = new Dictionary<UUID, InventoryItemBase>(256); 69 static protected Dictionary<UUID, InventoryItemBase> m_items = new Dictionary<UUID, InventoryItemBase>(256);
70 static LibraryService m_root; 70 static LibraryService m_root;
71 static object m_rootLock = new object(); 71 static object m_rootLock = new object();
72 static readonly uint m_BasePermissions = (uint)PermissionMask.AllAndExport;
73 static readonly uint m_EveryOnePermissions = (uint)PermissionMask.AllAndExportNoMod;
74 static readonly uint m_CurrentPermissions = (uint)PermissionMask.AllAndExport;
75 static readonly uint m_NextPermissions = (uint)PermissionMask.AllAndExport;
76 static readonly uint m_GroupPermissions = 0;
72 77
73 public LibraryService(IConfigSource config):base(config) 78 public LibraryService(IConfigSource config):base(config)
74 { 79 {
@@ -96,8 +101,8 @@ namespace OpenSim.Services.InventoryService
96 m_LibraryRootFolder.ID = new UUID("00000112-000f-0000-0000-000100bba000"); 101 m_LibraryRootFolder.ID = new UUID("00000112-000f-0000-0000-000100bba000");
97 m_LibraryRootFolder.Name = pLibName; 102 m_LibraryRootFolder.Name = pLibName;
98 m_LibraryRootFolder.ParentID = UUID.Zero; 103 m_LibraryRootFolder.ParentID = UUID.Zero;
99 m_LibraryRootFolder.Type = (short)8; 104 m_LibraryRootFolder.Type = 8;
100 m_LibraryRootFolder.Version = (ushort)1; 105 m_LibraryRootFolder.Version = 1;
101 106
102 libraryFolders.Add(m_LibraryRootFolder.ID, m_LibraryRootFolder); 107 libraryFolders.Add(m_LibraryRootFolder.ID, m_LibraryRootFolder);
103 108
@@ -117,10 +122,11 @@ namespace OpenSim.Services.InventoryService
117 item.AssetType = assetType; 122 item.AssetType = assetType;
118 item.InvType = invType; 123 item.InvType = invType;
119 item.Folder = parentFolderID; 124 item.Folder = parentFolderID;
120 item.BasePermissions = 0x7FFFFFFF; 125 item.BasePermissions = m_BasePermissions;
121 item.EveryOnePermissions = 0x7FFFFFFF; 126 item.EveryOnePermissions = m_EveryOnePermissions;
122 item.CurrentPermissions = 0x7FFFFFFF; 127 item.CurrentPermissions = m_CurrentPermissions;
123 item.NextPermissions = 0x7FFFFFFF; 128 item.NextPermissions = m_NextPermissions;
129 item.GroupPermissions = m_GroupPermissions;
124 return item; 130 return item;
125 } 131 }
126 132
@@ -142,6 +148,7 @@ namespace OpenSim.Services.InventoryService
142 protected void ReadLibraryFromConfig(IConfig config, string path) 148 protected void ReadLibraryFromConfig(IConfig config, string path)
143 { 149 {
144 string basePath = Path.GetDirectoryName(path); 150 string basePath = Path.GetDirectoryName(path);
151 m_LibraryRootFolder.Version = (ushort)config.GetInt("RootVersion", 1);
145 string foldersPath 152 string foldersPath
146 = Path.Combine( 153 = Path.Combine(
147 basePath, config.GetString("foldersFile", String.Empty)); 154 basePath, config.GetString("foldersFile", String.Empty));
@@ -167,9 +174,8 @@ namespace OpenSim.Services.InventoryService
167 folderInfo.Name = config.GetString("name", "unknown"); 174 folderInfo.Name = config.GetString("name", "unknown");
168 folderInfo.ParentID = new UUID(config.GetString("parentFolderID", m_LibraryRootFolder.ID.ToString())); 175 folderInfo.ParentID = new UUID(config.GetString("parentFolderID", m_LibraryRootFolder.ID.ToString()));
169 folderInfo.Type = (short)config.GetInt("type", 8); 176 folderInfo.Type = (short)config.GetInt("type", 8);
170 177 folderInfo.Version = (ushort)config.GetInt("version", 1);
171 folderInfo.Owner = libOwner; 178 folderInfo.Owner = libOwner;
172 folderInfo.Version = 1;
173 179
174 if (libraryFolders.ContainsKey(folderInfo.ParentID)) 180 if (libraryFolders.ContainsKey(folderInfo.ParentID))
175 { 181 {
@@ -205,11 +211,11 @@ namespace OpenSim.Services.InventoryService
205 item.Description = config.GetString("description", item.Name); 211 item.Description = config.GetString("description", item.Name);
206 item.InvType = config.GetInt("inventoryType", 0); 212 item.InvType = config.GetInt("inventoryType", 0);
207 item.AssetType = config.GetInt("assetType", item.InvType); 213 item.AssetType = config.GetInt("assetType", item.InvType);
208 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", (uint)PermissionMask.All); 214 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", m_CurrentPermissions);
209 item.NextPermissions = (uint)config.GetLong("nextPermissions", (uint)PermissionMask.All); 215 item.NextPermissions = (uint)config.GetLong("nextPermissions", m_NextPermissions);
210 item.EveryOnePermissions 216 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", m_EveryOnePermissions);
211 = (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All - (uint)PermissionMask.Modify); 217 item.BasePermissions = (uint)config.GetLong("basePermissions", m_BasePermissions);
212 item.BasePermissions = (uint)config.GetLong("basePermissions", (uint)PermissionMask.All); 218 item.GroupPermissions = (uint)config.GetLong("basePermissions", m_GroupPermissions);;
213 item.Flags = (uint)config.GetInt("flags", 0); 219 item.Flags = (uint)config.GetInt("flags", 0);
214 220
215 if (libraryFolders.ContainsKey(item.Folder)) 221 if (libraryFolders.ContainsKey(item.Folder))