change taskInventory copy/move to agents inventory rules

httptests
UbitUmarov 2017-05-03 16:03:26 +01:00
parent 8a330bc45d
commit 94bb6d965e
2 changed files with 19 additions and 17 deletions

View File

@ -1678,7 +1678,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false; return false;
} }
private bool CanReturnObjects(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects) private bool CanReturnObjects(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects)
{ {
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@ -2289,23 +2288,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sog == null) if (sog == null)
return false; return false;
uint perms = GetObjectPermissions(userID, sog, true); if(sog.OwnerID == userID || IsAdministrator(userID))
if((perms & (uint)PermissionMask.Modify) == 0) return true;
if(sog.IsAttachment)
return false;
UUID sogGroupID = sog.GroupID;
if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
return false; return false;
TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID); TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
if(ti == null) if(ti == null)
return false; return false;
uint itperms = GetObjectItemPermissions(userID, ti); ulong powers = 0;
if(GroupMemberPowers(sogGroupID, userID, ref powers))
{
if(powers == (ulong)GroupPowers.ObjectManipulate)
return true;
if((itperms & (uint)PermissionMask.Copy) == 0) if((ti.EveryonePermissions & (uint)PermissionMask.Copy) != 0)
return false; return true;
}
if(sog.OwnerID != userID && (itperms & (uint)PermissionMask.Transfer) == 0) return false;
return false;
return true;
} }
// object inventory to object inventory item drag and drop // object inventory to object inventory item drag and drop

View File

@ -1388,11 +1388,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId)) if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId))
{ return;
// check also if we can delete the no copy item
if(!Permissions.CanEditObject(part.UUID, remoteClient.AgentId))
return;
}
string message; string message;
InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message); InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message);
@ -1769,7 +1765,6 @@ namespace OpenSim.Region.Framework.Scenes
itemInfo.CurrentPermissions &= currentItem.BasePermissions; itemInfo.CurrentPermissions &= currentItem.BasePermissions;
itemInfo.NextPermissions &= currentItem.BasePermissions; itemInfo.NextPermissions &= currentItem.BasePermissions;
} }
} }
else else
{ {