aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/PermissionManager.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-30 04:54:15 +0000
committerTeravus Ovares2007-11-30 04:54:15 +0000
commit31cec30aa0a589f622635c689b08c2e026898556 (patch)
tree1f6763396fdd0eed5dff737a878b57f262cc06bc /OpenSim/Region/Environment/PermissionManager.cs
parent* This extends my first hack to clear out the useragent table for that specif... (diff)
downloadopensim-SC-31cec30aa0a589f622635c689b08c2e026898556.zip
opensim-SC-31cec30aa0a589f622635c689b08c2e026898556.tar.gz
opensim-SC-31cec30aa0a589f622635c689b08c2e026898556.tar.bz2
opensim-SC-31cec30aa0a589f622635c689b08c2e026898556.tar.xz
* Extended our semi-stupid implementation of in world object permissions to show a user's client that it can't edit a prim if it doesn't have permission.
* Permissions is due for a big revamp. The current way it's done is a hack at best.
Diffstat (limited to 'OpenSim/Region/Environment/PermissionManager.cs')
-rw-r--r--OpenSim/Region/Environment/PermissionManager.cs108
1 files changed, 108 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs
index bcaa1bf..9911792 100644
--- a/OpenSim/Region/Environment/PermissionManager.cs
+++ b/OpenSim/Region/Environment/PermissionManager.cs
@@ -135,6 +135,114 @@ namespace OpenSim.Region.Environment
135 135
136 #region Object Permissions 136 #region Object Permissions
137 137
138
139 public virtual bool AnyoneCanCopyPermission(LLUUID user, LLUUID objId)
140 {
141
142 // Default: deny
143 bool permission = false;
144
145 if (!m_scene.Entities.ContainsKey(objId))
146 {
147 return false;
148 }
149
150 // If it's not an object, we cant edit it.
151 if (!(m_scene.Entities[objId] is SceneObjectGroup))
152 {
153 return false;
154 }
155
156 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId];
157 LLUUID taskOwner = null;
158 // Added this because at this point in time it wouldn't be wise for
159 // the administrator object permissions to take effect.
160 LLUUID objectOwner = task.OwnerID;
161 uint objectflags = task.RootPart.EveryoneMask;
162
163 // Object owners should be able to edit their own content
164 if (user == objectOwner)
165 permission = true;
166
167 // If the 'anybody can move' flag is set then allow anyone to move it
168 if ((objectflags & (uint)LLObject.ObjectFlags.ObjectCopy ) != 0)
169 permission = true;
170
171 // Users should be able to edit what is over their land.
172 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
173 user)
174 permission = true;
175
176 // Estate users should be able to edit anything in the sim
177 if (IsEstateManager(user))
178 permission = true;
179
180 // Admin objects should not be editable by the above
181 if (IsAdministrator(taskOwner))
182 permission = false;
183
184 // Admin should be able to edit anything in the sim (including admin objects)
185 if (IsAdministrator(user))
186 permission = true;
187
188 return permission;
189
190 }
191
192
193 public virtual bool AnyoneCanMovePermission(LLUUID user, LLUUID objId)
194 {
195
196 // Default: deny
197 bool permission = false;
198
199 if (!m_scene.Entities.ContainsKey(objId))
200 {
201 return false;
202 }
203
204 // If it's not an object, we cant edit it.
205 if (!(m_scene.Entities[objId] is SceneObjectGroup))
206 {
207 return false;
208 }
209
210 SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId];
211 LLUUID taskOwner = null;
212 // Added this because at this point in time it wouldn't be wise for
213 // the administrator object permissions to take effect.
214 LLUUID objectOwner = task.OwnerID;
215 uint objectflags = task.RootPart.ObjectFlags;
216
217 // Object owners should be able to edit their own content
218 if (user == objectOwner)
219 permission = true;
220
221 // If the 'anybody can move' flag is set then allow anyone to move it
222 if ((objectflags & (uint)LLObject.ObjectFlags.ObjectMove) != 0)
223 permission = true;
224
225 // Users should be able to edit what is over their land.
226 if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
227 user)
228 permission = true;
229
230 // Estate users should be able to edit anything in the sim
231 if (IsEstateManager(user))
232 permission = true;
233
234 // Admin objects should not be editable by the above
235 if (IsAdministrator(taskOwner))
236 permission = false;
237
238 // Admin should be able to edit anything in the sim (including admin objects)
239 if (IsAdministrator(user))
240 permission = true;
241
242 return permission;
243
244 }
245
138 protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId) 246 protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId)
139 { 247 {
140 // Default: deny 248 // Default: deny