From 2ad9789b1ca85f64a8fd15be66d62b52bf8363f7 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 13 Jul 2010 23:46:49 +0100 Subject: [PATCH] factor out soon to be common media permissions check code --- .../World/Permissions/PermissionsModule.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 358ea59216..2344e9681f 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 if (null == me) return true; + return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); + } + + private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) + { if (IsAdministrator(agentID)) return true; - if ((me.ControlPermissions & MediaPermission.Anyone) == MediaPermission.Anyone) + if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) return true; - if ((me.ControlPermissions & MediaPermission.Owner) == MediaPermission.Owner) + if ((perms & MediaPermission.Owner) == MediaPermission.Owner) { if (agentID == part.OwnerID) return true; } - if ((me.ControlPermissions & MediaPermission.Group) == MediaPermission.Group) + if ((perms & MediaPermission.Group) == MediaPermission.Group) { if (IsGroupMember(part.GroupID, agentID, 0)) return true; } - return false; + return false; } } } \ No newline at end of file