Patch by revolution, thank you. Mantis #1789 . Implement friends permissions.

Applied with major changes. Core functionality commented pending review
for possible rights escalation. No user functionality yet.
This commit is contained in:
Melanie
2009-11-05 02:09:07 +00:00
parent 30a2411e58
commit 83b4b4440b
10 changed files with 71 additions and 3 deletions

View File

@@ -476,6 +476,37 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
}
protected bool IsFriendWithPerms(UUID user,UUID objectOwner)
{
if (user == UUID.Zero) return false;
List<FriendListItem> profile = m_scene.CommsManager.GetUserFriendList(user);
foreach (FriendListItem item in profile)
{
m_log.Warn("IsFriendWithPerms called" + item.FriendPerms.ToString());
if(item.Friend == objectOwner)
{
// if (item.FriendPerms == 3)
// {
// return true;
// }
// if (item.FriendPerms == 4)
// {
// return true;
// }
// if (item.FriendPerms == 5)
// {
// return true;
// }
// if (item.FriendPerms == 7)
// {
// return true;
// }
}
}
return false;
}
protected bool IsEstateManager(UUID user)
{
@@ -565,6 +596,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Object owners should be able to edit their own content
if (user == objectOwner)
return objectOwnerMask;
if (IsFriendWithPerms(user, objectOwner))
return objectOwnerMask;
// Estate users should be able to edit anything in the sim
if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner))