diff options
author | UbitUmarov | 2017-01-12 17:15:36 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-12 17:15:36 +0000 |
commit | 1984f316fc125d793ccf6cbea4f6ea7df9711d17 (patch) | |
tree | 3cabdf683295029f6b8b7ee3b3e05d627d8a0c5c /OpenSim | |
parent | GenerateClientFlags: consider locked state, change object group; CanRezObject... (diff) | |
download | opensim-SC_OLD-1984f316fc125d793ccf6cbea4f6ea7df9711d17.zip opensim-SC_OLD-1984f316fc125d793ccf6cbea4f6ea7df9711d17.tar.gz opensim-SC_OLD-1984f316fc125d793ccf6cbea4f6ea7df9711d17.tar.bz2 opensim-SC_OLD-1984f316fc125d793ccf6cbea4f6ea7df9711d17.tar.xz |
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).
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 2d62b50..e611897 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -183,8 +183,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
183 | part.SendFullUpdate(remoteClient); | 183 | part.SendFullUpdate(remoteClient); |
184 | 184 | ||
185 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | 185 | // A prim is only tainted if it's allowed to be edited by the person clicking it. |
186 | if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) | 186 | if (Permissions.CanChangeSelectedState(sog.UUID, (ScenePresence)remoteClient.SceneAgent)) |
187 | || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) | ||
188 | { | 187 | { |
189 | part.IsSelected = true; | 188 | part.IsSelected = true; |
190 | EventManager.TriggerParcelPrimCountTainted(); | 189 | EventManager.TriggerParcelPrimCountTainted(); |
@@ -250,8 +249,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
250 | // handled by group, but by prim. Legacy cruft. | 249 | // handled by group, but by prim. Legacy cruft. |
251 | // TODO: Make selection flagging per prim! | 250 | // TODO: Make selection flagging per prim! |
252 | // | 251 | // |
253 | if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) | 252 | if (Permissions.CanChangeSelectedState(part.ParentGroup.UUID, (ScenePresence)remoteClient.SceneAgent)) |
254 | || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId)) | ||
255 | { | 253 | { |
256 | part.IsSelected = false; | 254 | part.IsSelected = false; |
257 | if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) | 255 | if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index e045c43..8f32b03 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -404,6 +404,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
404 | 404 | ||
405 | #endregion | 405 | #endregion |
406 | 406 | ||
407 | #region persence EDIT or MOVE OBJECT | ||
408 | private const uint CANSELECTMASK = (uint)( | ||
409 | PrimFlags.ObjectMove | | ||
410 | PrimFlags.ObjectModify | | ||
411 | PrimFlags.ObjectOwnerModify | ||
412 | ); | ||
413 | |||
414 | public bool CanChangeSelectedState(UUID objectID, ScenePresence sp) | ||
415 | { | ||
416 | uint perms = GenerateClientFlags(sp , objectID); | ||
417 | return (perms & CANSELECTMASK) != 0; | ||
418 | } | ||
419 | |||
420 | #endregion | ||
407 | #region EDIT OBJECT | 421 | #region EDIT OBJECT |
408 | public bool CanEditObject(UUID objectID, UUID editorID) | 422 | public bool CanEditObject(UUID objectID, UUID editorID) |
409 | { | 423 | { |