Add permission CanChangeSelectedState replacing 2 calls to check Move and Modify/edit. As those calls did, this controls changes to objects selected state for edition (simulation hold etc).

melanie
UbitUmarov 2017-01-12 17:15:36 +00:00
parent 3e0a61915f
commit 1984f316fc
2 changed files with 16 additions and 4 deletions

View File

@ -183,8 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
part.SendFullUpdate(remoteClient); part.SendFullUpdate(remoteClient);
// A prim is only tainted if it's allowed to be edited by the person clicking it. // A prim is only tainted if it's allowed to be edited by the person clicking it.
if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) if (Permissions.CanChangeSelectedState(sog.UUID, (ScenePresence)remoteClient.SceneAgent))
|| Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
{ {
part.IsSelected = true; part.IsSelected = true;
EventManager.TriggerParcelPrimCountTainted(); EventManager.TriggerParcelPrimCountTainted();
@ -250,8 +249,7 @@ namespace OpenSim.Region.Framework.Scenes
// handled by group, but by prim. Legacy cruft. // handled by group, but by prim. Legacy cruft.
// TODO: Make selection flagging per prim! // TODO: Make selection flagging per prim!
// //
if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) if (Permissions.CanChangeSelectedState(part.ParentGroup.UUID, (ScenePresence)remoteClient.SceneAgent))
|| Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
{ {
part.IsSelected = false; part.IsSelected = false;
if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected)

View File

@ -404,6 +404,20 @@ namespace OpenSim.Region.Framework.Scenes
#endregion #endregion
#region persence EDIT or MOVE OBJECT
private const uint CANSELECTMASK = (uint)(
PrimFlags.ObjectMove |
PrimFlags.ObjectModify |
PrimFlags.ObjectOwnerModify
);
public bool CanChangeSelectedState(UUID objectID, ScenePresence sp)
{
uint perms = GenerateClientFlags(sp , objectID);
return (perms & CANSELECTMASK) != 0;
}
#endregion
#region EDIT OBJECT #region EDIT OBJECT
public bool CanEditObject(UUID objectID, UUID editorID) public bool CanEditObject(UUID objectID, UUID editorID)
{ {