When creating a coalesced object, set its permissions to the lowest-common-denominator of all the sub-objects

master-beforevarregion
Oren Hurvitz 2013-11-07 17:25:39 +02:00 committed by Justin Clark-Casey (justincc)
parent a94e1e0e08
commit 88f01a4130
1 changed files with 16 additions and 7 deletions

View File

@ -502,8 +502,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
IClientAPI remoteClient) IClientAPI remoteClient)
{ {
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7;
uint allObjectsNextOwnerPerms = 0x7fffffff;
uint allObjectsEveryOnePerms = 0x7fffffff;
uint allObjectsGroupPerms = 0x7fffffff;
foreach (SceneObjectGroup grp in objsForEffectivePermissions) foreach (SceneObjectGroup grp in objsForEffectivePermissions)
{
effectivePerms &= grp.GetEffectivePermissions(); effectivePerms &= grp.GetEffectivePermissions();
allObjectsNextOwnerPerms &= grp.RootPart.NextOwnerMask;
allObjectsEveryOnePerms &= grp.RootPart.EveryoneMask;
allObjectsGroupPerms &= grp.RootPart.GroupMask;
}
effectivePerms |= (uint)PermissionMask.Move; effectivePerms |= (uint)PermissionMask.Move;
//PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
@ -513,11 +522,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
uint perms = effectivePerms; uint perms = effectivePerms;
PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms); PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
item.BasePermissions = perms & so.RootPart.NextOwnerMask; item.BasePermissions = perms & allObjectsNextOwnerPerms;
item.CurrentPermissions = item.BasePermissions; item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = perms & so.RootPart.NextOwnerMask; item.NextPermissions = perms & allObjectsNextOwnerPerms;
item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; item.EveryOnePermissions = allObjectsEveryOnePerms & allObjectsNextOwnerPerms;
item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; item.GroupPermissions = allObjectsGroupPerms & allObjectsNextOwnerPerms;
// apply next owner perms on rez // apply next owner perms on rez
item.CurrentPermissions |= SceneObjectGroup.SLAM; item.CurrentPermissions |= SceneObjectGroup.SLAM;
@ -526,9 +535,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
item.BasePermissions = effectivePerms; item.BasePermissions = effectivePerms;
item.CurrentPermissions = effectivePerms; item.CurrentPermissions = effectivePerms;
item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms; item.NextPermissions = allObjectsNextOwnerPerms & effectivePerms;
item.EveryOnePermissions = so.RootPart.EveryoneMask & effectivePerms; item.EveryOnePermissions = allObjectsEveryOnePerms & effectivePerms;
item.GroupPermissions = so.RootPart.GroupMask & effectivePerms; item.GroupPermissions = allObjectsGroupPerms & effectivePerms;
item.CurrentPermissions &= item.CurrentPermissions &=
((uint)PermissionMask.Copy | ((uint)PermissionMask.Copy |