factor out soon to be common media permissions check code

prebuild-update
Justin Clark-Casey (justincc) 2010-07-13 23:46:49 +01:00
parent 6f644f5322
commit 2ad9789b1c
1 changed files with 9 additions and 4 deletions

View File

@ -1914,25 +1914,30 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (null == me) if (null == me)
return true; return true;
return GenericPrimMediaPermission(part, agentID, me.ControlPermissions);
}
private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms)
{
if (IsAdministrator(agentID)) if (IsAdministrator(agentID))
return true; return true;
if ((me.ControlPermissions & MediaPermission.Anyone) == MediaPermission.Anyone) if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone)
return true; return true;
if ((me.ControlPermissions & MediaPermission.Owner) == MediaPermission.Owner) if ((perms & MediaPermission.Owner) == MediaPermission.Owner)
{ {
if (agentID == part.OwnerID) if (agentID == part.OwnerID)
return true; return true;
} }
if ((me.ControlPermissions & MediaPermission.Group) == MediaPermission.Group) if ((perms & MediaPermission.Group) == MediaPermission.Group)
{ {
if (IsGroupMember(part.GroupID, agentID, 0)) if (IsGroupMember(part.GroupID, agentID, 0))
return true; return true;
} }
return false; return false;
} }
} }
} }