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.

0.6.6-post-fixes
MW 2009-05-30 15:20:39 +00:00
parent ea02a24161
commit 94f4953e31
1 changed files with 28 additions and 21 deletions

View File

@ -284,7 +284,7 @@ namespace OpenSim.Grid.UserServer.Modules
if (modifyPerms) if (modifyPerms)
{ {
ModifyPermissions(clonedItem); ModifyPermissions(ref clonedItem);
} }
SynchronousRestObjectRequester.MakeRequest<InventoryItemBase, bool>( SynchronousRestObjectRequester.MakeRequest<InventoryItemBase, bool>(
@ -296,28 +296,35 @@ namespace OpenSim.Grid.UserServer.Modules
return UUID.Zero; return UUID.Zero;
} }
private void ModifyPermissions(InventoryItemBase item) protected virtual void ModifyPermissions(ref InventoryItemBase item)
{ {
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0) // Propagate Permissions
item.CurrentPermissions |= (uint)PermissionMask.Modify; item.BasePermissions = item.BasePermissions & item.NextPermissions;
item.CurrentPermissions = item.BasePermissions;
item.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
item.GroupPermissions = item.GroupPermissions & item.NextPermissions;
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) //set all items to +mod/+copy/- transfer
item.CurrentPermissions |= (uint)PermissionMask.Copy; //if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
// item.CurrentPermissions |= (uint)PermissionMask.Modify;
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) //if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; // item.CurrentPermissions |= (uint)PermissionMask.Copy;
if ((item.NextPermissions & (uint)PermissionMask.Modify) == 0) //if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0)
item.NextPermissions |= (uint)PermissionMask.Modify; // item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
if ((item.NextPermissions & (uint)PermissionMask.Copy) == 0) //if ((item.NextPermissions & (uint)PermissionMask.Modify) == 0)
item.NextPermissions |= (uint)PermissionMask.Copy; // item.NextPermissions |= (uint)PermissionMask.Modify;
if ((item.NextPermissions & (uint)PermissionMask.Transfer) != 0) //if ((item.NextPermissions & (uint)PermissionMask.Copy) == 0)
item.NextPermissions &= ~(uint)PermissionMask.Transfer; // item.NextPermissions |= (uint)PermissionMask.Copy;
if ((item.EveryOnePermissions & (uint)PermissionMask.Transfer) != 0) //if ((item.NextPermissions & (uint)PermissionMask.Transfer) != 0)
item.EveryOnePermissions &= ~(uint)PermissionMask.Transfer; // item.NextPermissions &= ~(uint)PermissionMask.Transfer;
//if ((item.EveryOnePermissions & (uint)PermissionMask.Transfer) != 0)
// item.EveryOnePermissions &= ~(uint)PermissionMask.Transfer;
} }
private AvatarAppearance CreateDefaultAppearance(UUID avatarId) private AvatarAppearance CreateDefaultAppearance(UUID avatarId)
@ -387,7 +394,7 @@ namespace OpenSim.Grid.UserServer.Modules
foreach (InventoryItemBase item in templateItems) foreach (InventoryItemBase item in templateItems)
{ {
UUID clonedItemId = CloneInventoryItem(avID, toFolder.ID, item, false); UUID clonedItemId = CloneInventoryItem(avID, toFolder.ID, item, true);
if (clonedItemId != UUID.Zero) if (clonedItemId != UUID.Zero)
{ {
int appearanceType = ItemIsPartOfAppearance(item, appearance); int appearanceType = ItemIsPartOfAppearance(item, appearance);