diff options
author | UbitUmarov | 2017-01-17 23:22:02 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-17 23:22:02 +0000 |
commit | 6d784f63060940bd82a2be776385abd40901f57c (patch) | |
tree | c4d98d5348737d6282408b8d88fc9c66ea082ca0 /OpenSim/Region/Framework/Scenes | |
parent | Permissions module: add GetObjectPermissions() that should replace GenericObj... (diff) | |
download | opensim-SC-6d784f63060940bd82a2be776385abd40901f57c.zip opensim-SC-6d784f63060940bd82a2be776385abd40901f57c.tar.gz opensim-SC-6d784f63060940bd82a2be776385abd40901f57c.tar.bz2 opensim-SC-6d784f63060940bd82a2be776385abd40901f57c.tar.xz |
Permissions module: GenerateClientFlags() no need to keep looking for the same part several times; fix locked mask in GetObjectPermissions()
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 12 |
2 files changed, 7 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index e611897..f2d853d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -183,7 +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.CanChangeSelectedState(sog.UUID, (ScenePresence)remoteClient.SceneAgent)) | 186 | if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent)) |
187 | { | 187 | { |
188 | part.IsSelected = true; | 188 | part.IsSelected = true; |
189 | EventManager.TriggerParcelPrimCountTainted(); | 189 | EventManager.TriggerParcelPrimCountTainted(); |
@@ -249,7 +249,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
249 | // handled by group, but by prim. Legacy cruft. | 249 | // handled by group, but by prim. Legacy cruft. |
250 | // TODO: Make selection flagging per prim! | 250 | // TODO: Make selection flagging per prim! |
251 | // | 251 | // |
252 | if (Permissions.CanChangeSelectedState(part.ParentGroup.UUID, (ScenePresence)remoteClient.SceneAgent)) | 252 | if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent)) |
253 | { | 253 | { |
254 | part.IsSelected = false; | 254 | part.IsSelected = false; |
255 | 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 8f32b03..e42d4c2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -37,7 +37,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
37 | namespace OpenSim.Region.Framework.Scenes | 37 | namespace OpenSim.Region.Framework.Scenes |
38 | { | 38 | { |
39 | #region Delegates | 39 | #region Delegates |
40 | public delegate uint GenerateClientFlagsHandler(ScenePresence sp, uint curEffectivePerms, UUID objectID); | 40 | public delegate uint GenerateClientFlagsHandler(SceneObjectPart part, ScenePresence sp, uint curEffectivePerms); |
41 | public delegate void SetBypassPermissionsHandler(bool value); | 41 | public delegate void SetBypassPermissionsHandler(bool value); |
42 | public delegate bool BypassPermissionsHandler(); | 42 | public delegate bool BypassPermissionsHandler(); |
43 | public delegate bool PropagatePermissionsHandler(); | 43 | public delegate bool PropagatePermissionsHandler(); |
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
167 | 167 | ||
168 | #region Object Permission Checks | 168 | #region Object Permission Checks |
169 | 169 | ||
170 | public uint GenerateClientFlags(ScenePresence sp, UUID objectID) | 170 | public uint GenerateClientFlags( SceneObjectPart part, ScenePresence sp) |
171 | { | 171 | { |
172 | // libomv will moan about PrimFlags.ObjectYouOfficer being | 172 | // libomv will moan about PrimFlags.ObjectYouOfficer being |
173 | // obsolete... | 173 | // obsolete... |
@@ -182,8 +182,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
182 | PrimFlags.ObjectOwnerModify; | 182 | PrimFlags.ObjectOwnerModify; |
183 | #pragma warning restore 0612 | 183 | #pragma warning restore 0612 |
184 | 184 | ||
185 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); | ||
186 | |||
187 | if (part == null) | 185 | if (part == null) |
188 | return 0; | 186 | return 0; |
189 | 187 | ||
@@ -195,7 +193,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
195 | Delegate[] list = handlerGenerateClientFlags.GetInvocationList(); | 193 | Delegate[] list = handlerGenerateClientFlags.GetInvocationList(); |
196 | foreach (GenerateClientFlagsHandler check in list) | 194 | foreach (GenerateClientFlagsHandler check in list) |
197 | { | 195 | { |
198 | perms &= check(sp, perms, objectID); | 196 | perms &= check(part, sp, perms); |
199 | } | 197 | } |
200 | } | 198 | } |
201 | return perms; | 199 | return perms; |
@@ -411,9 +409,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
411 | PrimFlags.ObjectOwnerModify | 409 | PrimFlags.ObjectOwnerModify |
412 | ); | 410 | ); |
413 | 411 | ||
414 | public bool CanChangeSelectedState(UUID objectID, ScenePresence sp) | 412 | public bool CanChangeSelectedState(SceneObjectPart part, ScenePresence sp) |
415 | { | 413 | { |
416 | uint perms = GenerateClientFlags(sp , objectID); | 414 | uint perms = GenerateClientFlags(part, sp); |
417 | return (perms & CANSELECTMASK) != 0; | 415 | return (perms & CANSELECTMASK) != 0; |
418 | } | 416 | } |
419 | 417 | ||