mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
* [MRM] Implements permission checks on IObject implementations in SOPObject.cs. Does not implement security on IObjectInventory yet.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
class SecurityCredential : ISecurityCredential
|
||||
{
|
||||
private readonly ISocialEntity m_owner;
|
||||
private readonly Scene m_scene;
|
||||
|
||||
public SecurityCredential(ISocialEntity m_owner)
|
||||
{
|
||||
@@ -17,5 +20,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
get { return m_owner; }
|
||||
}
|
||||
|
||||
public bool CanEditObject(IObject target)
|
||||
{
|
||||
return m_scene.Permissions.CanEditObject(target.GlobalID, m_owner.GlobalID);
|
||||
}
|
||||
|
||||
public bool CanEditTerrain(int x, int y)
|
||||
{
|
||||
return m_scene.Permissions.CanTerraformLand(m_owner.GlobalID, new Vector3(x, y, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user