aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-12 13:29:38 +0000
committerMelanie Thielker2009-05-12 13:29:38 +0000
commit32ac388363c42a069f6dbc9650c030675da36a83 (patch)
tree8091eb26c6299c3c0d6057c7265bc204c75ed0d6
parent* Applies Mantis #3630 - Adds support for outside MRM initialisation, makes M... (diff)
downloadopensim-SC_OLD-32ac388363c42a069f6dbc9650c030675da36a83.zip
opensim-SC_OLD-32ac388363c42a069f6dbc9650c030675da36a83.tar.gz
opensim-SC_OLD-32ac388363c42a069f6dbc9650c030675da36a83.tar.bz2
opensim-SC_OLD-32ac388363c42a069f6dbc9650c030675da36a83.tar.xz
Add permission mechanisms for group deeding land
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs17
2 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 874e8b7..46a0da2 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -128,6 +128,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
128 m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags; 128 m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags;
129 m_scene.Permissions.OnAbandonParcel += CanAbandonParcel; 129 m_scene.Permissions.OnAbandonParcel += CanAbandonParcel;
130 m_scene.Permissions.OnReclaimParcel += CanReclaimParcel; 130 m_scene.Permissions.OnReclaimParcel += CanReclaimParcel;
131 m_scene.Permissions.OnDeedParcel += CanDeedParcel;
131 m_scene.Permissions.OnIsGod += IsGod; 132 m_scene.Permissions.OnIsGod += IsGod;
132 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; 133 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
133 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED 134 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
@@ -683,6 +684,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions
683 return GenericParcelPermission(user, parcel); 684 return GenericParcelPermission(user, parcel);
684 } 685 }
685 686
687 private bool CanDeedParcel(UUID user, ILandObject parcel, Scene scene)
688 {
689 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
690 if (m_bypassPermissions) return m_bypassPermissionsValue;
691
692 if (parcel.landData.OwnerID != user) // Only the owner can deed!
693 return false;
694
695 ScenePresence sp = scene.GetScenePresence(user);
696 IClientAPI client = sp.ControllingClient;
697
698 if ((client.GetGroupPowers(parcel.landData.GroupID) & (long)GroupPowers.LandDeed) == 0)
699 return false;
700
701 return GenericParcelPermission(user, parcel);
702 }
703
686 private bool IsGod(UUID user, Scene scene) 704 private bool IsGod(UUID user, Scene scene)
687 { 705 {
688 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 706 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index 985179c..29a6cd2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -67,6 +67,7 @@ namespace OpenSim.Region.Framework.Scenes
67 public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); 67 public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
68 public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); 68 public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
69 public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); 69 public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene);
70 public delegate bool DeedParcelHandler(UUID user, ILandObject parcel, Scene scene);
70 public delegate bool BuyLandHandler(UUID user, ILandObject parcel, Scene scene); 71 public delegate bool BuyLandHandler(UUID user, ILandObject parcel, Scene scene);
71 public delegate bool LinkObjectHandler(UUID user, UUID objectID); 72 public delegate bool LinkObjectHandler(UUID user, UUID objectID);
72 public delegate bool DelinkObjectHandler(UUID user, UUID objectID); 73 public delegate bool DelinkObjectHandler(UUID user, UUID objectID);
@@ -122,6 +123,7 @@ namespace OpenSim.Region.Framework.Scenes
122 public event SellParcelHandler OnSellParcel; 123 public event SellParcelHandler OnSellParcel;
123 public event AbandonParcelHandler OnAbandonParcel; 124 public event AbandonParcelHandler OnAbandonParcel;
124 public event ReclaimParcelHandler OnReclaimParcel; 125 public event ReclaimParcelHandler OnReclaimParcel;
126 public event DeedParcelHandler OnDeedParcel;
125 public event BuyLandHandler OnBuyLand; 127 public event BuyLandHandler OnBuyLand;
126 public event LinkObjectHandler OnLinkObject; 128 public event LinkObjectHandler OnLinkObject;
127 public event DelinkObjectHandler OnDelinkObject; 129 public event DelinkObjectHandler OnDelinkObject;
@@ -696,6 +698,21 @@ namespace OpenSim.Region.Framework.Scenes
696 return true; 698 return true;
697 } 699 }
698 700
701 public bool CanDeedParcel(UUID user, ILandObject parcel)
702 {
703 DeedParcelHandler handler = OnDeedParcel;
704 if (handler != null)
705 {
706 Delegate[] list = handler.GetInvocationList();
707 foreach (DeedParcelHandler h in list)
708 {
709 if (h(user, parcel, m_scene) == false)
710 return false;
711 }
712 }
713 return true;
714 }
715
699 public bool CanBuyLand(UUID user, ILandObject parcel) 716 public bool CanBuyLand(UUID user, ILandObject parcel)
700 { 717 {
701 BuyLandHandler handler = OnBuyLand; 718 BuyLandHandler handler = OnBuyLand;