* More work on PermissionManager

afrisby
Adam Frisby 2007-08-04 00:56:56 +00:00
parent a425e92168
commit 3fc2d86dfe
2 changed files with 44 additions and 5 deletions

View File

@ -70,9 +70,8 @@ namespace OpenSim.Region.Environment
/// <param name="corner">Which corner</param>
/// <param name="lowValue">Minimum height that texture range should cover</param>
/// <param name="highValue">Maximum height that texture range should cover</param>
public void setEstateTextureRange(UInt16 corner, float lowValue, float highValue)
public void setEstateTextureRange(Int16 corner, float lowValue, float highValue)
{
switch (corner)
{
case 0:
@ -99,7 +98,7 @@ namespace OpenSim.Region.Environment
/// </summary>
/// <param name="band">Which texture band</param>
/// <param name="textureUUID">The UUID of the texture</param>
public void setTerrainTexture(UInt16 band, LLUUID textureUUID)
public void setTerrainTexture(Int16 band, LLUUID textureUUID)
{
switch (band)
{
@ -265,7 +264,7 @@ namespace OpenSim.Region.Environment
if (splitField.Length == 3)
{
UInt16 corner = Convert.ToInt16(splitField[0]);
Int16 corner = Convert.ToInt16(splitField[0]);
float lowValue = (float)Convert.ToDecimal(splitField[1]);
float highValue = (float)Convert.ToDecimal(splitField[2]);
@ -283,7 +282,7 @@ namespace OpenSim.Region.Environment
string[] splitField = s.Split(' ');
if (splitField.Length == 2)
{
UInt16 corner = Convert.ToInt16(splitField[0]);
Int16 corner = Convert.ToInt16(splitField[0]);
LLUUID textureUUID = new LLUUID(splitField[1]);
setTerrainTexture(corner, textureUUID);

View File

@ -20,6 +20,15 @@ namespace OpenSim.Region.Environment
m_scene = world;
}
public delegate void OnPermissionErrorDelegate(LLUUID user, string reason);
public event OnPermissionErrorDelegate OnPermissionError;
protected virtual void SendPermissionError(LLUUID user, string reason)
{
if (OnPermissionError != null)
OnPermissionError(user, reason);
}
protected virtual bool IsAdministrator(LLUUID user)
{
return m_scene.RegionInfo.MasterAvatarAssignedUUID == user;
@ -104,5 +113,36 @@ namespace OpenSim.Region.Environment
{
return false;
}
public virtual bool CanEditEstateSettings(LLUUID user)
{
// Default: deny
bool canEdit = false;
// Estate admins should be able to use estate tools
if (IsEstateManager(user))
canEdit = true;
// Administrators always have permission
if (IsAdministrator(user))
canEdit = true;
return canEdit;
}
public virtual bool CanEditParcel(LLUUID user, Land parcel)
{
return false;
}
public virtual bool CanSellParcel(LLUUID user, Land parcel)
{
return false;
}
public virtual bool CanAbandonParcel(LLUUID user, Land parcel)
{
return false;
}
}
}