Add permission mechanisms for group deeding land

0.6.5-rc1
Melanie Thielker 2009-05-12 13:29:38 +00:00
parent 559355189a
commit 32ac388363
2 changed files with 35 additions and 0 deletions

View File

@ -128,6 +128,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags;
m_scene.Permissions.OnAbandonParcel += CanAbandonParcel;
m_scene.Permissions.OnReclaimParcel += CanReclaimParcel;
m_scene.Permissions.OnDeedParcel += CanDeedParcel;
m_scene.Permissions.OnIsGod += IsGod;
m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
@ -683,6 +684,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return GenericParcelPermission(user, parcel);
}
private bool CanDeedParcel(UUID user, ILandObject parcel, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (parcel.landData.OwnerID != user) // Only the owner can deed!
return false;
ScenePresence sp = scene.GetScenePresence(user);
IClientAPI client = sp.ControllingClient;
if ((client.GetGroupPowers(parcel.landData.GroupID) & (long)GroupPowers.LandDeed) == 0)
return false;
return GenericParcelPermission(user, parcel);
}
private bool IsGod(UUID user, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);

View File

@ -67,6 +67,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool DeedParcelHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool BuyLandHandler(UUID user, ILandObject parcel, Scene scene);
public delegate bool LinkObjectHandler(UUID user, UUID objectID);
public delegate bool DelinkObjectHandler(UUID user, UUID objectID);
@ -122,6 +123,7 @@ namespace OpenSim.Region.Framework.Scenes
public event SellParcelHandler OnSellParcel;
public event AbandonParcelHandler OnAbandonParcel;
public event ReclaimParcelHandler OnReclaimParcel;
public event DeedParcelHandler OnDeedParcel;
public event BuyLandHandler OnBuyLand;
public event LinkObjectHandler OnLinkObject;
public event DelinkObjectHandler OnDelinkObject;
@ -696,6 +698,21 @@ namespace OpenSim.Region.Framework.Scenes
return true;
}
public bool CanDeedParcel(UUID user, ILandObject parcel)
{
DeedParcelHandler handler = OnDeedParcel;
if (handler != null)
{
Delegate[] list = handler.GetInvocationList();
foreach (DeedParcelHandler h in list)
{
if (h(user, parcel, m_scene) == false)
return false;
}
}
return true;
}
public bool CanBuyLand(UUID user, ILandObject parcel)
{
BuyLandHandler handler = OnBuyLand;