diff options
author | Justin Clark-Casey (justincc) | 2010-07-13 23:46:49 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:20 +0100 |
commit | a9101feb107e5d210c93df5ee3119d827a1c8320 (patch) | |
tree | 02f051845631fcae2e7cb42cc9989b08c815fe0f /OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |
parent | implement prim media control permissions serverside in order to stop bad clients (diff) | |
download | opensim-SC_OLD-a9101feb107e5d210c93df5ee3119d827a1c8320.zip opensim-SC_OLD-a9101feb107e5d210c93df5ee3119d827a1c8320.tar.gz opensim-SC_OLD-a9101feb107e5d210c93df5ee3119d827a1c8320.tar.bz2 opensim-SC_OLD-a9101feb107e5d210c93df5ee3119d827a1c8320.tar.xz |
factor out soon to be common media permissions check code
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 358ea59..2344e96 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -1914,25 +1914,30 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1914 | if (null == me) | 1914 | if (null == me) |
1915 | return true; | 1915 | return true; |
1916 | 1916 | ||
1917 | return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); | ||
1918 | } | ||
1919 | |||
1920 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) | ||
1921 | { | ||
1917 | if (IsAdministrator(agentID)) | 1922 | if (IsAdministrator(agentID)) |
1918 | return true; | 1923 | return true; |
1919 | 1924 | ||
1920 | if ((me.ControlPermissions & MediaPermission.Anyone) == MediaPermission.Anyone) | 1925 | if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) |
1921 | return true; | 1926 | return true; |
1922 | 1927 | ||
1923 | if ((me.ControlPermissions & MediaPermission.Owner) == MediaPermission.Owner) | 1928 | if ((perms & MediaPermission.Owner) == MediaPermission.Owner) |
1924 | { | 1929 | { |
1925 | if (agentID == part.OwnerID) | 1930 | if (agentID == part.OwnerID) |
1926 | return true; | 1931 | return true; |
1927 | } | 1932 | } |
1928 | 1933 | ||
1929 | if ((me.ControlPermissions & MediaPermission.Group) == MediaPermission.Group) | 1934 | if ((perms & MediaPermission.Group) == MediaPermission.Group) |
1930 | { | 1935 | { |
1931 | if (IsGroupMember(part.GroupID, agentID, 0)) | 1936 | if (IsGroupMember(part.GroupID, agentID, 0)) |
1932 | return true; | 1937 | return true; |
1933 | } | 1938 | } |
1934 | 1939 | ||
1935 | return false; | 1940 | return false; |
1936 | } | 1941 | } |
1937 | } | 1942 | } |
1938 | } \ No newline at end of file | 1943 | } \ No newline at end of file |