diff options
author | Teravus Ovares | 2008-05-15 19:28:10 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-15 19:28:10 +0000 |
commit | d60e4574633e50d257730cc582a6efb63c8e9d7b (patch) | |
tree | 3c51a5db9284eec4a29962a877e4c2f9dd0fc51a /OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |
parent | remove my UserAppearance object, switch all code to use (diff) | |
download | opensim-SC-d60e4574633e50d257730cc582a6efb63c8e9d7b.zip opensim-SC-d60e4574633e50d257730cc582a6efb63c8e9d7b.tar.gz opensim-SC-d60e4574633e50d257730cc582a6efb63c8e9d7b.tar.bz2 opensim-SC-d60e4574633e50d257730cc582a6efb63c8e9d7b.tar.xz |
Committing patch from Melanie. 0001290: [PATCH] implement permissions propagation and script module hooks. Thanks Melanie!
* Implements quite a few inventory related perms.
* (from Teravus) Fixes Take Copy
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index fcc6c75..645c302 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |||
@@ -61,7 +61,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
61 | 61 | ||
62 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) | 62 | public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) |
63 | { | 63 | { |
64 | uint perms=(uint)2147483647; | 64 | SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); |
65 | |||
66 | uint perms=part.GetEffectiveObjectFlags() | | ||
67 | (uint)LLObject.ObjectFlags.ObjectModify | | ||
68 | (uint)LLObject.ObjectFlags.ObjectCopy | | ||
69 | (uint)LLObject.ObjectFlags.ObjectMove | | ||
70 | (uint)LLObject.ObjectFlags.ObjectTransfer | | ||
71 | (uint)LLObject.ObjectFlags.ObjectYouOwner | | ||
72 | (uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
73 | |||
65 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) | 74 | foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) |
66 | { | 75 | { |
67 | perms &= check(userID, objectID); | 76 | perms &= check(userID, objectID); |
@@ -117,6 +126,32 @@ namespace OpenSim.Region.Environment.Scenes | |||
117 | return true; | 126 | return true; |
118 | } | 127 | } |
119 | 128 | ||
129 | public delegate bool PropagatePermissions(); | ||
130 | private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); | ||
131 | |||
132 | public void addPropagatePermissions(PropagatePermissions delegateFunc) | ||
133 | { | ||
134 | if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
135 | PropagatePermissionsCheckFunctions.Add(delegateFunc); | ||
136 | } | ||
137 | public void removePropagatePermissions(PropagatePermissions delegateFunc) | ||
138 | { | ||
139 | if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) | ||
140 | PropagatePermissionsCheckFunctions.Remove(delegateFunc); | ||
141 | } | ||
142 | |||
143 | public bool ExternalChecksPropagatePermissions() | ||
144 | { | ||
145 | foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) | ||
146 | { | ||
147 | if (check() == false) | ||
148 | { | ||
149 | return false; | ||
150 | } | ||
151 | } | ||
152 | return true; | ||
153 | } | ||
154 | |||
120 | #region REZ OBJECT | 155 | #region REZ OBJECT |
121 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); | 156 | public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); |
122 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); | 157 | private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); |