aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs74
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs8
5 files changed, 76 insertions, 20 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 5b93ef9..51f2942 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -115,7 +115,6 @@ namespace OpenSim.Region.Environment.Scenes
115 protected IXMLRPC m_xmlrpcModule; 115 protected IXMLRPC m_xmlrpcModule;
116 protected IWorldComm m_worldCommModule; 116 protected IWorldComm m_worldCommModule;
117 protected IAvatarFactory m_AvatarFactory; 117 protected IAvatarFactory m_AvatarFactory;
118 protected IScenePermissions m_permissions;
119 protected IConfigSource m_config; 118 protected IConfigSource m_config;
120 119
121 // Central Update Loop 120 // Central Update Loop
@@ -173,14 +172,6 @@ namespace OpenSim.Region.Environment.Scenes
173 get { return m_timedilation; } 172 get { return m_timedilation; }
174 } 173 }
175 174
176 /// <summary>
177 /// The reference by which general permissions in the scene can be set and queried.
178 /// </summary>
179 public IScenePermissions Permissions
180 {
181 get { return m_permissions; }
182 }
183
184 public int TimePhase 175 public int TimePhase
185 { 176 {
186 get { return m_timePhase; } 177 get { return m_timePhase; }
@@ -660,7 +651,6 @@ namespace OpenSim.Region.Environment.Scenes
660 m_worldCommModule = RequestModuleInterface<IWorldComm>(); 651 m_worldCommModule = RequestModuleInterface<IWorldComm>();
661 XferManager = RequestModuleInterface<IXfer>(); 652 XferManager = RequestModuleInterface<IXfer>();
662 m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); 653 m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
663 m_permissions = RequestModuleInterface<IScenePermissions>();
664 } 654 }
665 655
666 #endregion 656 #endregion
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index aa4e043..53c8fc3 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -45,6 +45,78 @@ namespace OpenSim.Region.Environment.Scenes
45 45
46 #region Object Permission Checks 46 #region Object Permission Checks
47 47
48 public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID);
49 private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>();
50
51 public void addGenerateClientFlags(GenerateClientFlags delegateFunc)
52 {
53 if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc))
54 GenerateClientFlagsCheckFunctions.Add(delegateFunc);
55 }
56 public void removeGenerateClientFlags(GenerateClientFlags delegateFunc)
57 {
58 if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc))
59 GenerateClientFlagsCheckFunctions.Remove(delegateFunc);
60 }
61
62 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID)
63 {
64 uint perms=(uint)2147483647;
65 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
66 {
67 perms &= check(userID, objectID);
68 }
69 return perms;
70 }
71
72 public delegate void SetBypassPermissions(bool value);
73 private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>();
74
75 public void addSetBypassPermissions(SetBypassPermissions delegateFunc)
76 {
77 if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc))
78 SetBypassPermissionsCheckFunctions.Add(delegateFunc);
79 }
80 public void removeSetBypassPermissions(SetBypassPermissions delegateFunc)
81 {
82 if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc))
83 SetBypassPermissionsCheckFunctions.Remove(delegateFunc);
84 }
85
86 public void ExternalChecksSetBypassPermissions(bool value)
87 {
88 foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions)
89 {
90 check(value);
91 }
92 }
93
94 public delegate bool BypassPermissions();
95 private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>();
96
97 public void addBypassPermissions(BypassPermissions delegateFunc)
98 {
99 if (!BypassPermissionsCheckFunctions.Contains(delegateFunc))
100 BypassPermissionsCheckFunctions.Add(delegateFunc);
101 }
102 public void removeBypassPermissions(BypassPermissions delegateFunc)
103 {
104 if (BypassPermissionsCheckFunctions.Contains(delegateFunc))
105 BypassPermissionsCheckFunctions.Remove(delegateFunc);
106 }
107
108 public bool ExternalChecksBypassPermissions()
109 {
110 foreach (BypassPermissions check in BypassPermissionsCheckFunctions)
111 {
112 if (check() == false)
113 {
114 return false;
115 }
116 }
117 return true;
118 }
119
48 #region REZ OBJECT 120 #region REZ OBJECT
49 public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); 121 public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene);
50 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); 122 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>();
@@ -654,4 +726,4 @@ namespace OpenSim.Region.Environment.Scenes
654 726
655 } 727 }
656} 728}
657 \ No newline at end of file 729
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index 1f1f39f..215ab75 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -191,7 +191,7 @@ namespace OpenSim.Region.Environment.Scenes
191 191
192 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) 192 public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions)
193 { 193 {
194 ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.BypassPermissions = bypassPermissions; }); 194 ForEachCurrentScene(delegate(Scene scene) { scene.ExternalChecks.ExternalChecksSetBypassPermissions(bypassPermissions); });
195 } 195 }
196 196
197 private void ForEachCurrentScene(Action<Scene> func) 197 private void ForEachCurrentScene(Action<Scene> func)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 4a112ae..3ec6ed8 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1351,7 +1351,7 @@ namespace OpenSim.Region.Environment.Scenes
1351 if (part.OwnerID != cAgentID) 1351 if (part.OwnerID != cAgentID)
1352 { 1352 {
1353 // Apply Next Owner Permissions if we're not bypassing permissions 1353 // Apply Next Owner Permissions if we're not bypassing permissions
1354 if (!m_scene.Permissions.BypassPermissions) 1354 if (!m_scene.ExternalChecks.ExternalChecksBypassPermissions())
1355 m_rootPart.ApplyNextOwnerPermissions(); 1355 m_rootPart.ApplyNextOwnerPermissions();
1356 } 1356 }
1357 1357
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 4ef0d27..8ac1a77 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -476,13 +476,7 @@ namespace OpenSim.Region.Environment.Scenes
476 476
477 public uint GenerateClientFlags(LLUUID ObjectID) 477 public uint GenerateClientFlags(LLUUID ObjectID)
478 { 478 {
479 if(m_scene.Permissions == null) 479 return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID);
480 {
481 SceneObjectPart task=m_scene.GetSceneObjectPart(ObjectID);
482
483 return task.GetEffectiveObjectFlags() | (uint)2147483647;
484 }
485 return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
486 } 480 }
487 481
488 /// <summary> 482 /// <summary>