aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-14 23:25:07 +0000
committerTeravus Ovares2008-05-14 23:25:07 +0000
commita4efa939932f823af2affe0e97446a8d807004e0 (patch)
tree58f8b1341aa2a14178bf707841cd368d5394429f /OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
parent* Refactored IConfigSource into Physics plug-ins and Scene. We can get rid of... (diff)
downloadopensim-SC_OLD-a4efa939932f823af2affe0e97446a8d807004e0.zip
opensim-SC_OLD-a4efa939932f823af2affe0e97446a8d807004e0.tar.gz
opensim-SC_OLD-a4efa939932f823af2affe0e97446a8d807004e0.tar.bz2
opensim-SC_OLD-a4efa939932f823af2affe0e97446a8d807004e0.tar.xz
* Comitting 0001271: [PATCH] Refactor permissions to fully allow stacking permissions modules. From Melanie. Thanks Melanie!
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs74
1 files changed, 73 insertions, 1 deletions
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