diff options
author | Justin Clark-Casey (justincc) | 2010-07-13 23:58:19 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:21 +0100 |
commit | ee6cd884c9732b492675e043fe318ffcdfecc45d (patch) | |
tree | ce3343d85b54bb04a5182a4cd65355988075ad68 /OpenSim/Region/CoreModules/World/Permissions | |
parent | factor out soon to be common media permissions check code (diff) | |
download | opensim-SC_OLD-ee6cd884c9732b492675e043fe318ffcdfecc45d.zip opensim-SC_OLD-ee6cd884c9732b492675e043fe318ffcdfecc45d.tar.gz opensim-SC_OLD-ee6cd884c9732b492675e043fe318ffcdfecc45d.tar.bz2 opensim-SC_OLD-ee6cd884c9732b492675e043fe318ffcdfecc45d.tar.xz |
implement serverside checks for media texture navigation in order to stop naughty clients
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 2344e96..3a690af 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -251,6 +251,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
251 | m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED | 251 | m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED |
252 | 252 | ||
253 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; | 253 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; |
254 | m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; | ||
254 | 255 | ||
255 | m_scene.AddCommand(this, "bypass permissions", | 256 | m_scene.AddCommand(this, "bypass permissions", |
256 | "bypass permissions <true / false>", | 257 | "bypass permissions <true / false>", |
@@ -1915,7 +1916,25 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1915 | return true; | 1916 | return true; |
1916 | 1917 | ||
1917 | return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); | 1918 | return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); |
1918 | } | 1919 | } |
1920 | |||
1921 | private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) | ||
1922 | { | ||
1923 | if (null == m_moapModule) | ||
1924 | return false; | ||
1925 | |||
1926 | SceneObjectPart part = m_scene.GetSceneObjectPart(primID); | ||
1927 | if (null == part) | ||
1928 | return false; | ||
1929 | |||
1930 | MediaEntry me = m_moapModule.GetMediaEntry(part, face); | ||
1931 | |||
1932 | // If there is no existing media entry then it can be controlled (in this context, created). | ||
1933 | if (null == me) | ||
1934 | return true; | ||
1935 | |||
1936 | return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); | ||
1937 | } | ||
1919 | 1938 | ||
1920 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) | 1939 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) |
1921 | { | 1940 | { |