From 8f0b03597b0bc8ea6873af9a55495407fae1ec56 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 19 Sep 2007 00:30:55 +0000 Subject: * Modernized ScriptManager to new interface-based module calls. * 'remove redundant this qualifier' ftw --- OpenSim/Region/Environment/PermissionManager.cs | 38 +++++++++++-------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region/Environment/PermissionManager.cs') diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index cb455f4..0a33380 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs @@ -1,14 +1,7 @@ -using System.Collections.Generic; -using OpenSim.Framework; -using OpenSim.Framework.Types; -using OpenSim.Framework.Communications; -using OpenSim.Framework.Servers; -using OpenSim.Region.Capabilities; -using OpenSim.Region.Environment.Scenes; -using OpenSim.Region.Environment.LandManagement; - -using libsecondlife; - +using libsecondlife; +using OpenSim.Region.Environment.LandManagement; +using OpenSim.Region.Environment.Scenes; + namespace OpenSim.Region.Environment { public class PermissionManager @@ -19,7 +12,8 @@ namespace OpenSim.Region.Environment // disable in any production environment // TODO: Change this to false when permissions are a desired default // TODO: Move to configuration option. - private bool m_bypassPermissions = true; + private bool m_bypassPermissions = true; + public bool BypassPermissions { get { return m_bypassPermissions; } @@ -104,26 +98,27 @@ namespace OpenSim.Region.Environment // Default: deny bool permission = false; - if( !m_scene.Entities.ContainsKey( objId )) + if (!m_scene.Entities.ContainsKey(objId)) { return false; } - + // If it's not an object, we cant edit it. if (!(m_scene.Entities[objId] is SceneObjectGroup)) { return false; } - - SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId]; - LLUUID taskOwner = null; + + SceneObjectGroup task = (SceneObjectGroup) m_scene.Entities[objId]; + LLUUID taskOwner = null; // Object owners should be able to edit their own content if (user == taskOwner) permission = true; // Users should be able to edit what is over their land. - if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID == user) + if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID == + user) permission = true; // Estate users should be able to edit anything in the sim @@ -270,7 +265,7 @@ namespace OpenSim.Region.Environment // TODO: Need to do some extra checks here. Requires group code. } - if(IsEstateManager(user)) + if (IsEstateManager(user)) permission = true; if (IsAdministrator(user)) @@ -299,7 +294,6 @@ namespace OpenSim.Region.Environment return GenericParcelPermission(user, parcel); } - #endregion - + #endregion } -} +} \ No newline at end of file -- cgit v1.1