diff options
author | Justin Clark-Casey (justincc) | 2010-07-14 23:26:24 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:21 +0100 |
commit | 049ccba8d3b71583f9f1aa7d13ca4a7f60501871 (patch) | |
tree | 1a1165bd9b6d38faf6b7a7b163f833fdac5ef477 /OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |
parent | implement code to deregister users on DeregisterCaps (diff) | |
download | opensim-SC_OLD-049ccba8d3b71583f9f1aa7d13ca4a7f60501871.zip opensim-SC_OLD-049ccba8d3b71583f9f1aa7d13ca4a7f60501871.tar.gz opensim-SC_OLD-049ccba8d3b71583f9f1aa7d13ca4a7f60501871.tar.bz2 opensim-SC_OLD-049ccba8d3b71583f9f1aa7d13ca4a7f60501871.tar.xz |
fix previous media interact serverside checking. perform very basic serverside url whitelist checks
at the moment, only checking for the exact name prefix is implemented
for some reason, whitelists are not persisting
this commit also fixes a very recent problem where setting any media texture parameters after the initial configuration would not work
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 3a690af..7f6f851 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
178 | 178 | ||
179 | string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); | 179 | string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); |
180 | 180 | ||
181 | List<string> modules=new List<string>(permissionModules.Split(',')); | 181 | List<string> modules = new List<string>(permissionModules.Split(',')); |
182 | 182 | ||
183 | if (!modules.Contains("DefaultPermissionsModule")) | 183 | if (!modules.Contains("DefaultPermissionsModule")) |
184 | return; | 184 | return; |
@@ -399,6 +399,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
399 | m_log.Warn("[PERMISSIONS]: Groups module not found, group permissions will not work"); | 399 | m_log.Warn("[PERMISSIONS]: Groups module not found, group permissions will not work"); |
400 | 400 | ||
401 | m_moapModule = m_scene.RequestModuleInterface<IMoapModule>(); | 401 | m_moapModule = m_scene.RequestModuleInterface<IMoapModule>(); |
402 | |||
403 | // This log line will be commented out when no longer required for debugging | ||
404 | if (m_moapModule == null) | ||
405 | m_log.Warn("[PERMISSIONS]: Media on a prim module not found, media on a prim permissions will not work"); | ||
402 | } | 406 | } |
403 | 407 | ||
404 | public void Close() | 408 | public void Close() |
@@ -1901,7 +1905,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1901 | } | 1905 | } |
1902 | 1906 | ||
1903 | private bool CanControlPrimMedia(UUID agentID, UUID primID, int face) | 1907 | private bool CanControlPrimMedia(UUID agentID, UUID primID, int face) |
1904 | { | 1908 | { |
1909 | // m_log.DebugFormat( | ||
1910 | // "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}", | ||
1911 | // agentID, primID, face); | ||
1912 | |||
1905 | if (null == m_moapModule) | 1913 | if (null == m_moapModule) |
1906 | return false; | 1914 | return false; |
1907 | 1915 | ||
@@ -1909,17 +1917,25 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1909 | if (null == part) | 1917 | if (null == part) |
1910 | return false; | 1918 | return false; |
1911 | 1919 | ||
1912 | MediaEntry me = m_moapModule.GetMediaEntry(part, face); | 1920 | MediaEntry me = m_moapModule.GetMediaEntry(part, face); |
1913 | 1921 | ||
1914 | // If there is no existing media entry then it can be controlled (in this context, created). | 1922 | // If there is no existing media entry then it can be controlled (in this context, created). |
1915 | if (null == me) | 1923 | if (null == me) |
1916 | return true; | 1924 | return true; |
1917 | 1925 | ||
1926 | m_log.DebugFormat( | ||
1927 | "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", | ||
1928 | agentID, primID, face, me.ControlPermissions); | ||
1929 | |||
1918 | return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); | 1930 | return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); |
1919 | } | 1931 | } |
1920 | 1932 | ||
1921 | private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) | 1933 | private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) |
1922 | { | 1934 | { |
1935 | // m_log.DebugFormat( | ||
1936 | // "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}", | ||
1937 | // agentID, primID, face); | ||
1938 | |||
1923 | if (null == m_moapModule) | 1939 | if (null == m_moapModule) |
1924 | return false; | 1940 | return false; |
1925 | 1941 | ||
@@ -1933,13 +1949,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1933 | if (null == me) | 1949 | if (null == me) |
1934 | return true; | 1950 | return true; |
1935 | 1951 | ||
1952 | m_log.DebugFormat( | ||
1953 | "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", | ||
1954 | agentID, primID, face, me.InteractPermissions); | ||
1955 | |||
1936 | return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); | 1956 | return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); |
1937 | } | 1957 | } |
1938 | 1958 | ||
1939 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) | 1959 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) |
1940 | { | 1960 | { |
1941 | if (IsAdministrator(agentID)) | 1961 | // if (IsAdministrator(agentID)) |
1942 | return true; | 1962 | // return true; |
1943 | 1963 | ||
1944 | if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) | 1964 | if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) |
1945 | return true; | 1965 | return true; |