diff options
author | Teravus Ovares | 2007-12-05 06:44:32 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-05 06:44:32 +0000 |
commit | bb824eadeeb2b35025954d0c97f15123c6fd0cbe (patch) | |
tree | afca518b8e5b806cd2e7ab7965d34765d4b18bc4 /OpenSim/Region/Environment/PermissionManager.cs | |
parent | fixed a few compiler warnings under mono (committed from a train, with adjohn... (diff) | |
download | opensim-SC_OLD-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.zip opensim-SC_OLD-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.tar.gz opensim-SC_OLD-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.tar.bz2 opensim-SC_OLD-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.tar.xz |
* Refactored Permissions into ScenePresence as requested by MW
* Un-hackerized generating the client_flags
* Now handling the ObjectPermissions Update packet
* Warning: Backup your prim before updating. If you fail to do so and something goes wrong then, All Yr prim are belong to us!
Diffstat (limited to 'OpenSim/Region/Environment/PermissionManager.cs')
-rw-r--r-- | OpenSim/Region/Environment/PermissionManager.cs | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index 9911792..573fc29 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs | |||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment | |||
164 | if (user == objectOwner) | 164 | if (user == objectOwner) |
165 | permission = true; | 165 | permission = true; |
166 | 166 | ||
167 | // If the 'anybody can move' flag is set then allow anyone to move it | 167 | // If the 'anybody can move' flag is set then allow anyone to copy it |
168 | if ((objectflags & (uint)LLObject.ObjectFlags.ObjectCopy ) != 0) | 168 | if ((objectflags & (uint)LLObject.ObjectFlags.ObjectCopy ) != 0) |
169 | permission = true; | 169 | permission = true; |
170 | 170 | ||
@@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment | |||
212 | // Added this because at this point in time it wouldn't be wise for | 212 | // Added this because at this point in time it wouldn't be wise for |
213 | // the administrator object permissions to take effect. | 213 | // the administrator object permissions to take effect. |
214 | LLUUID objectOwner = task.OwnerID; | 214 | LLUUID objectOwner = task.OwnerID; |
215 | uint objectflags = task.RootPart.ObjectFlags; | 215 | uint objectflags = task.RootPart.EveryoneMask; |
216 | 216 | ||
217 | // Object owners should be able to edit their own content | 217 | // Object owners should be able to edit their own content |
218 | if (user == objectOwner) | 218 | if (user == objectOwner) |
@@ -242,6 +242,54 @@ namespace OpenSim.Region.Environment | |||
242 | return permission; | 242 | return permission; |
243 | 243 | ||
244 | } | 244 | } |
245 | public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID) | ||
246 | { | ||
247 | if (!m_scene.Entities.ContainsKey(objID)) | ||
248 | { | ||
249 | return 0; | ||
250 | } | ||
251 | |||
252 | // If it's not an object, we cant edit it. | ||
253 | if (!(m_scene.Entities[objID] is SceneObjectGroup)) | ||
254 | { | ||
255 | return 0; | ||
256 | } | ||
257 | |||
258 | SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objID]; | ||
259 | LLUUID taskOwner = null; | ||
260 | // Added this because at this point in time it wouldn't be wise for | ||
261 | // the administrator object permissions to take effect. | ||
262 | LLUUID objectOwner = task.OwnerID; | ||
263 | uint OwnerMask = task.RootPart.ObjectFlags | task.RootPart.OwnerMask; | ||
264 | uint GroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask; | ||
265 | uint EveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask; | ||
266 | |||
267 | if (m_bypassPermissions) | ||
268 | return OwnerMask; | ||
269 | |||
270 | // Object owners should be able to edit their own content | ||
271 | if (user == objectOwner) | ||
272 | return OwnerMask; | ||
273 | |||
274 | // Users should be able to edit what is over their land. | ||
275 | if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID == | ||
276 | user) | ||
277 | return OwnerMask; | ||
278 | |||
279 | // Estate users should be able to edit anything in the sim | ||
280 | if (IsEstateManager(user)) | ||
281 | return OwnerMask; | ||
282 | |||
283 | // Admin objects should not be editable by the above | ||
284 | if (IsAdministrator(taskOwner)) | ||
285 | return EveryoneMask; | ||
286 | |||
287 | // Admin should be able to edit anything in the sim (including admin objects) | ||
288 | if (IsAdministrator(user)) | ||
289 | return OwnerMask; | ||
290 | |||
291 | return 0; | ||
292 | } | ||
245 | 293 | ||
246 | protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId) | 294 | protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId) |
247 | { | 295 | { |