diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 105 |
1 files changed, 82 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index b0fdd11..1b3fdc3 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -258,56 +258,65 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
258 | m_scene.Permissions.OnBypassPermissions += BypassPermissions; | 258 | m_scene.Permissions.OnBypassPermissions += BypassPermissions; |
259 | m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions; | 259 | m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions; |
260 | m_scene.Permissions.OnPropagatePermissions += PropagatePermissions; | 260 | m_scene.Permissions.OnPropagatePermissions += PropagatePermissions; |
261 | |||
262 | m_scene.Permissions.OnIsGridGod += IsGridAdministrator; | ||
263 | m_scene.Permissions.OnIsAdministrator += IsAdministrator; | ||
264 | m_scene.Permissions.OnIsEstateManager += IsEstateManager; | ||
265 | |||
261 | m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags; | 266 | m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags; |
267 | |||
268 | m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; | ||
269 | m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; | ||
270 | |||
271 | m_scene.Permissions.OnTeleport += CanTeleport; | ||
272 | |||
273 | m_scene.Permissions.OnInstantMessage += CanInstantMessage; | ||
274 | |||
262 | m_scene.Permissions.OnAbandonParcel += CanAbandonParcel; | 275 | m_scene.Permissions.OnAbandonParcel += CanAbandonParcel; |
263 | m_scene.Permissions.OnReclaimParcel += CanReclaimParcel; | 276 | m_scene.Permissions.OnReclaimParcel += CanReclaimParcel; |
264 | m_scene.Permissions.OnDeedParcel += CanDeedParcel; | 277 | m_scene.Permissions.OnDeedParcel += CanDeedParcel; |
265 | m_scene.Permissions.OnDeedObject += CanDeedObject; | 278 | m_scene.Permissions.OnSellParcel += CanSellParcel; |
266 | m_scene.Permissions.OnIsGridGod += IsGridAdministrator; | 279 | m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; |
267 | m_scene.Permissions.OnIsAdministrator += IsAdministrator; | 280 | m_scene.Permissions.OnTerraformLand += CanTerraformLand; |
268 | m_scene.Permissions.OnIsEstateManager += IsEstateManager; | 281 | m_scene.Permissions.OnBuyLand += CanBuyLand; |
282 | |||
283 | m_scene.Permissions.OnRezObject += CanRezObject; | ||
284 | m_scene.Permissions.OnObjectEntry += CanObjectEntry; | ||
285 | m_scene.Permissions.OnReturnObjects += CanReturnObjects; | ||
286 | |||
269 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 287 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
270 | m_scene.Permissions.OnDeleteObjectByIDs += CanDeleteObjectByIDs; | 288 | m_scene.Permissions.OnDeleteObjectByIDs += CanDeleteObjectByIDs; |
271 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; | 289 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; |
272 | m_scene.Permissions.OnEditObjectByIDs += CanEditObjectByIDs; | 290 | m_scene.Permissions.OnEditObjectByIDs += CanEditObjectByIDs; |
273 | m_scene.Permissions.OnEditObject += CanEditObject; | 291 | m_scene.Permissions.OnEditObject += CanEditObject; |
274 | m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; | ||
275 | m_scene.Permissions.OnInstantMessage += CanInstantMessage; | ||
276 | m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; | 292 | m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; |
277 | m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; | ||
278 | m_scene.Permissions.OnMoveObject += CanMoveObject; | 293 | m_scene.Permissions.OnMoveObject += CanMoveObject; |
279 | m_scene.Permissions.OnObjectEntry += CanObjectEntry; | ||
280 | m_scene.Permissions.OnReturnObjects += CanReturnObjects; | ||
281 | m_scene.Permissions.OnRezObject += CanRezObject; | ||
282 | m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; | ||
283 | m_scene.Permissions.OnRunScript += CanRunScript; | ||
284 | m_scene.Permissions.OnCompileScript += CanCompileScript; | ||
285 | m_scene.Permissions.OnSellParcel += CanSellParcel; | ||
286 | m_scene.Permissions.OnTakeObject += CanTakeObject; | 294 | m_scene.Permissions.OnTakeObject += CanTakeObject; |
287 | m_scene.Permissions.OnSellGroupObject += CanSellGroupObject; | ||
288 | m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; | 295 | m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; |
289 | m_scene.Permissions.OnTerraformLand += CanTerraformLand; | ||
290 | m_scene.Permissions.OnLinkObject += CanLinkObject; | 296 | m_scene.Permissions.OnLinkObject += CanLinkObject; |
291 | m_scene.Permissions.OnDelinkObject += CanDelinkObject; | 297 | m_scene.Permissions.OnDelinkObject += CanDelinkObject; |
292 | m_scene.Permissions.OnBuyLand += CanBuyLand; | 298 | m_scene.Permissions.OnDeedObject += CanDeedObject; |
299 | m_scene.Permissions.OnSellGroupObject += CanSellGroupObject; | ||
293 | 300 | ||
294 | m_scene.Permissions.OnViewNotecard += CanViewNotecard; | ||
295 | m_scene.Permissions.OnViewScript += CanViewScript; | ||
296 | m_scene.Permissions.OnEditNotecard += CanEditNotecard; | ||
297 | m_scene.Permissions.OnEditScript += CanEditScript; | ||
298 | 301 | ||
299 | m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; | 302 | m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; |
300 | m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory; | 303 | m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory; |
301 | m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; | 304 | m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; |
302 | m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; | 305 | m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; |
306 | |||
307 | m_scene.Permissions.OnViewNotecard += CanViewNotecard; | ||
308 | m_scene.Permissions.OnViewScript += CanViewScript; | ||
309 | m_scene.Permissions.OnEditNotecard += CanEditNotecard; | ||
310 | m_scene.Permissions.OnEditScript += CanEditScript; | ||
303 | m_scene.Permissions.OnResetScript += CanResetScript; | 311 | m_scene.Permissions.OnResetScript += CanResetScript; |
312 | m_scene.Permissions.OnRunScript += CanRunScript; | ||
313 | m_scene.Permissions.OnCompileScript += CanCompileScript; | ||
304 | 314 | ||
305 | m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; | 315 | m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; |
306 | m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; | 316 | m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; |
307 | m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; | 317 | m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; |
308 | m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; | 318 | m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; |
309 | 319 | ||
310 | m_scene.Permissions.OnTeleport += CanTeleport; | ||
311 | 320 | ||
312 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; | 321 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; |
313 | m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; | 322 | m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; |
@@ -2061,7 +2070,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2061 | if (sog == null) | 2070 | if (sog == null) |
2062 | return false; | 2071 | return false; |
2063 | 2072 | ||
2064 | uint perms = GetObjectPermissions(objectID, sog, true); | 2073 | uint perms = GetObjectPermissions(userID, sog, true); |
2065 | if((perms & (uint)PermissionMask.Modify) == 0) | 2074 | if((perms & (uint)PermissionMask.Modify) == 0) |
2066 | return false; | 2075 | return false; |
2067 | 2076 | ||
@@ -2080,6 +2089,56 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2080 | return true; | 2089 | return true; |
2081 | } | 2090 | } |
2082 | 2091 | ||
2092 | // object inventory to object inventory item drag and drop | ||
2093 | private bool CanDoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart) | ||
2094 | { | ||
2095 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | ||
2096 | if (m_bypassPermissions) return m_bypassPermissionsValue; | ||
2097 | |||
2098 | if (sourcePart == null || destPart == null || item == null) | ||
2099 | return false; | ||
2100 | |||
2101 | SceneObjectGroup srcsog = sourcePart.ParentGroup; | ||
2102 | SceneObjectGroup destsog = destPart.ParentGroup; | ||
2103 | if (srcsog == null || destsog == null) | ||
2104 | return false; | ||
2105 | |||
2106 | // dest is locked | ||
2107 | if((destsog.EffectiveOwnerPerms & (uint)PermissionMask.Move) == 0) | ||
2108 | return false; | ||
2109 | |||
2110 | uint itperms = item.CurrentPermissions; | ||
2111 | |||
2112 | // if item is no copy the source is modifed | ||
2113 | if((itperms & (uint)PermissionMask.Copy) == 0 && (srcsog.EffectiveOwnerPerms & (uint)PermissionMask.Modify) == 0) | ||
2114 | return false; | ||
2115 | |||
2116 | UUID srcOwner = srcsog.OwnerID; | ||
2117 | UUID destOwner = destsog.OwnerID; | ||
2118 | bool notSameOwner = srcOwner != destOwner; | ||
2119 | |||
2120 | if(notSameOwner) | ||
2121 | { | ||
2122 | if((itperms & (uint)PermissionMask.Transfer) == 0) | ||
2123 | return false; | ||
2124 | |||
2125 | // scripts can't be droped | ||
2126 | if(item.InvType == (int)InventoryType.LSL) | ||
2127 | return false; | ||
2128 | |||
2129 | if((destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) | ||
2130 | return false; | ||
2131 | } | ||
2132 | else | ||
2133 | { | ||
2134 | if((destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0 && | ||
2135 | (destsog.EffectiveOwnerPerms & (uint)PermissionMask.Modify) == 0) | ||
2136 | return false; | ||
2137 | } | ||
2138 | |||
2139 | return true; | ||
2140 | } | ||
2141 | |||
2083 | private bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) | 2142 | private bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) |
2084 | { | 2143 | { |
2085 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 2144 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |