aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorMelanie2009-11-05 02:09:07 +0000
committerMelanie2009-11-05 02:09:07 +0000
commit83b4b4440b7becb405840bc69d665e260fdecea0 (patch)
treea623dc9c6d82bfb96d1db978d2464e3cbaf4d0ca /OpenSim/Region/CoreModules/World
parentSeparate folder and item limit for UDP inventory packets. Folder limit is (diff)
downloadopensim-SC-83b4b4440b7becb405840bc69d665e260fdecea0.zip
opensim-SC-83b4b4440b7becb405840bc69d665e260fdecea0.tar.gz
opensim-SC-83b4b4440b7becb405840bc69d665e260fdecea0.tar.bz2
opensim-SC-83b4b4440b7becb405840bc69d665e260fdecea0.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index fe9de1b..effe1f0 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -476,6 +476,37 @@ namespace OpenSim.Region.CoreModules.World.Permissions
476 476
477 return false; 477 return false;
478 } 478 }
479 protected bool IsFriendWithPerms(UUID user,UUID objectOwner)
480 {
481
482 if (user == UUID.Zero) return false;
483
484 List<FriendListItem> profile = m_scene.CommsManager.GetUserFriendList(user);
485 foreach (FriendListItem item in profile)
486 {
487 m_log.Warn("IsFriendWithPerms called" + item.FriendPerms.ToString());
488 if(item.Friend == objectOwner)
489 {
490// if (item.FriendPerms == 3)
491// {
492// return true;
493// }
494// if (item.FriendPerms == 4)
495// {
496// return true;
497// }
498// if (item.FriendPerms == 5)
499// {
500// return true;
501// }
502// if (item.FriendPerms == 7)
503// {
504// return true;
505// }
506 }
507 }
508 return false;
509 }
479 510
480 protected bool IsEstateManager(UUID user) 511 protected bool IsEstateManager(UUID user)
481 { 512 {
@@ -565,6 +596,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
565 // Object owners should be able to edit their own content 596 // Object owners should be able to edit their own content
566 if (user == objectOwner) 597 if (user == objectOwner)
567 return objectOwnerMask; 598 return objectOwnerMask;
599
600 if (IsFriendWithPerms(user, objectOwner))
601 return objectOwnerMask;
568 602
569 // Estate users should be able to edit anything in the sim 603 // Estate users should be able to edit anything in the sim
570 if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner)) 604 if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner))