diff options
author | Justin Clark-Casey (justincc) | 2010-07-13 23:46:49 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-13 23:46:49 +0100 |
commit | 2ad9789b1ca85f64a8fd15be66d62b52bf8363f7 (patch) | |
tree | 2b38f581e137cb9f6179b9b9322623f212c80917 | |
parent | implement prim media control permissions serverside in order to stop bad clients (diff) | |
download | opensim-SC-2ad9789b1ca85f64a8fd15be66d62b52bf8363f7.zip opensim-SC-2ad9789b1ca85f64a8fd15be66d62b52bf8363f7.tar.gz opensim-SC-2ad9789b1ca85f64a8fd15be66d62b52bf8363f7.tar.bz2 opensim-SC-2ad9789b1ca85f64a8fd15be66d62b52bf8363f7.tar.xz |
factor out soon to be common media permissions check code
-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 |