diff options
author | MW | 2009-05-30 15:20:39 +0000 |
---|---|---|
committer | MW | 2009-05-30 15:20:39 +0000 |
commit | 94f4953e313b8a2f938151d750e4cf250a3446be (patch) | |
tree | 19e7f617523c5d50957f1fb942ebae25d60f6d3a | |
parent | a few small changes to AvatarCreationModule (diff) | |
download | opensim-SC-94f4953e313b8a2f938151d750e4cf250a3446be.zip opensim-SC-94f4953e313b8a2f938151d750e4cf250a3446be.tar.gz opensim-SC-94f4953e313b8a2f938151d750e4cf250a3446be.tar.bz2 opensim-SC-94f4953e313b8a2f938151d750e4cf250a3446be.tar.xz |
Made it so ( by default) the Clone avatar function, propagates the permissions on the cloned items. This needs further testing to make sure all permissions are set correctly.
-rw-r--r-- | OpenSim/Grid/UserServer.Modules/AvatarCreationModule.cs | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/OpenSim/Grid/UserServer.Modules/AvatarCreationModule.cs b/OpenSim/Grid/UserServer.Modules/AvatarCreationModule.cs index 5507f5c..1bf6049 100644 --- a/OpenSim/Grid/UserServer.Modules/AvatarCreationModule.cs +++ b/OpenSim/Grid/UserServer.Modules/AvatarCreationModule.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | private UserDataBaseService m_userDataBaseService; | 50 | private UserDataBaseService m_userDataBaseService; |
51 | // private BaseHttpServer m_httpServer; | 51 | // private BaseHttpServer m_httpServer; |
52 | private UserConfig m_config; | 52 | private UserConfig m_config; |
53 | 53 | ||
54 | private string m_inventoryServerUrl; | 54 | private string m_inventoryServerUrl; |
@@ -80,7 +80,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
80 | 80 | ||
81 | public void RegisterHandlers(BaseHttpServer httpServer) | 81 | public void RegisterHandlers(BaseHttpServer httpServer) |
82 | { | 82 | { |
83 | } | 83 | } |
84 | 84 | ||
85 | public void RunCommand(string module, string[] cmd) | 85 | public void RunCommand(string module, string[] cmd) |
86 | { | 86 | { |
@@ -163,7 +163,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
163 | m_log.InfoFormat("[AvatarAppearance] finished cloning avatar with result: {0}", success); | 163 | m_log.InfoFormat("[AvatarAppearance] finished cloning avatar with result: {0}", success); |
164 | return success; | 164 | return success; |
165 | } | 165 | } |
166 | 166 | ||
167 | private void UpdateAvatarAppearance(UUID avatarID, int wearableType, UUID itemID, UUID assetID) | 167 | private void UpdateAvatarAppearance(UUID avatarID, int wearableType, UUID itemID, UUID assetID) |
168 | { | 168 | { |
169 | AvatarAppearance appearance = m_userDataBaseService.GetUserAppearance(avatarID); | 169 | AvatarAppearance appearance = m_userDataBaseService.GetUserAppearance(avatarID); |
@@ -284,7 +284,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
284 | 284 | ||
285 | if (modifyPerms) | 285 | if (modifyPerms) |
286 | { | 286 | { |
287 | ModifyPermissions(clonedItem); | 287 | ModifyPermissions(ref clonedItem); |
288 | } | 288 | } |
289 | 289 | ||
290 | SynchronousRestObjectRequester.MakeRequest<InventoryItemBase, bool>( | 290 | SynchronousRestObjectRequester.MakeRequest<InventoryItemBase, bool>( |
@@ -296,28 +296,35 @@ namespace OpenSim.Grid.UserServer.Modules | |||
296 | return UUID.Zero; | 296 | return UUID.Zero; |
297 | } | 297 | } |
298 | 298 | ||
299 | private void ModifyPermissions(InventoryItemBase item) | 299 | protected virtual void ModifyPermissions(ref InventoryItemBase item) |
300 | { | 300 | { |
301 | if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0) | 301 | // Propagate Permissions |
302 | item.CurrentPermissions |= (uint)PermissionMask.Modify; | 302 | item.BasePermissions = item.BasePermissions & item.NextPermissions; |
303 | item.CurrentPermissions = item.BasePermissions; | ||
304 | item.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions; | ||
305 | item.GroupPermissions = item.GroupPermissions & item.NextPermissions; | ||
303 | 306 | ||
304 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 307 | //set all items to +mod/+copy/- transfer |
305 | item.CurrentPermissions |= (uint)PermissionMask.Copy; | 308 | //if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0) |
309 | // item.CurrentPermissions |= (uint)PermissionMask.Modify; | ||
306 | 310 | ||
307 | if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) | 311 | //if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
308 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | 312 | // item.CurrentPermissions |= (uint)PermissionMask.Copy; |
309 | 313 | ||
310 | if ((item.NextPermissions & (uint)PermissionMask.Modify) == 0) | 314 | //if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) |
311 | item.NextPermissions |= (uint)PermissionMask.Modify; | 315 | // item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; |
312 | 316 | ||
313 | if ((item.NextPermissions & (uint)PermissionMask.Copy) == 0) | 317 | //if ((item.NextPermissions & (uint)PermissionMask.Modify) == 0) |
314 | item.NextPermissions |= (uint)PermissionMask.Copy; | 318 | // item.NextPermissions |= (uint)PermissionMask.Modify; |
315 | 319 | ||
316 | if ((item.NextPermissions & (uint)PermissionMask.Transfer) != 0) | 320 | //if ((item.NextPermissions & (uint)PermissionMask.Copy) == 0) |
317 | item.NextPermissions &= ~(uint)PermissionMask.Transfer; | 321 | // item.NextPermissions |= (uint)PermissionMask.Copy; |
318 | 322 | ||
319 | if ((item.EveryOnePermissions & (uint)PermissionMask.Transfer) != 0) | 323 | //if ((item.NextPermissions & (uint)PermissionMask.Transfer) != 0) |
320 | item.EveryOnePermissions &= ~(uint)PermissionMask.Transfer; | 324 | // item.NextPermissions &= ~(uint)PermissionMask.Transfer; |
325 | |||
326 | //if ((item.EveryOnePermissions & (uint)PermissionMask.Transfer) != 0) | ||
327 | // item.EveryOnePermissions &= ~(uint)PermissionMask.Transfer; | ||
321 | } | 328 | } |
322 | 329 | ||
323 | private AvatarAppearance CreateDefaultAppearance(UUID avatarId) | 330 | private AvatarAppearance CreateDefaultAppearance(UUID avatarId) |
@@ -349,7 +356,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
349 | } | 356 | } |
350 | #endregion | 357 | #endregion |
351 | 358 | ||
352 | 359 | ||
353 | 360 | ||
354 | private bool CloneFolder(List<InventoryFolderBase> avatarInventory, UUID avID, UUID parentFolder, AvatarAppearance appearance, InventoryFolderBase templateFolder, List<InventoryFolderBase> templateFolders) | 361 | private bool CloneFolder(List<InventoryFolderBase> avatarInventory, UUID avID, UUID parentFolder, AvatarAppearance appearance, InventoryFolderBase templateFolder, List<InventoryFolderBase> templateFolders) |
355 | { | 362 | { |
@@ -387,7 +394,7 @@ namespace OpenSim.Grid.UserServer.Modules | |||
387 | foreach (InventoryItemBase item in templateItems) | 394 | foreach (InventoryItemBase item in templateItems) |
388 | { | 395 | { |
389 | 396 | ||
390 | UUID clonedItemId = CloneInventoryItem(avID, toFolder.ID, item, false); | 397 | UUID clonedItemId = CloneInventoryItem(avID, toFolder.ID, item, true); |
391 | if (clonedItemId != UUID.Zero) | 398 | if (clonedItemId != UUID.Zero) |
392 | { | 399 | { |
393 | int appearanceType = ItemIsPartOfAppearance(item, appearance); | 400 | int appearanceType = ItemIsPartOfAppearance(item, appearance); |