diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 686f4ba..9b30d87 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
105 | userInfo.AddItem(item); | 105 | userInfo.AddItem(item); |
106 | 106 | ||
107 | int userlevel = 0; | 107 | int userlevel = 0; |
108 | if (ExternalChecks.ExternalChecksCanBeGodLike(AgentID)) | 108 | if (Permissions.IsGod(AgentID)) |
109 | { | 109 | { |
110 | userlevel = 1; | 110 | userlevel = 1; |
111 | } | 111 | } |
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
171 | { | 171 | { |
172 | if ((InventoryType) item.InvType == InventoryType.Notecard) | 172 | if ((InventoryType) item.InvType == InventoryType.Notecard) |
173 | { | 173 | { |
174 | if (!ExternalChecks.ExternalChecksCanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId)) | 174 | if (!Permissions.CanEditNotecard(itemID, UUID.Zero, remoteClient.AgentId)) |
175 | { | 175 | { |
176 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); | 176 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); |
177 | return UUID.Zero; | 177 | return UUID.Zero; |
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
180 | } | 180 | } |
181 | else if ((InventoryType) item.InvType == InventoryType.LSL) | 181 | else if ((InventoryType) item.InvType == InventoryType.LSL) |
182 | { | 182 | { |
183 | if (!ExternalChecks.ExternalChecksCanEditScript(itemID, UUID.Zero, remoteClient.AgentId)) | 183 | if (!Permissions.CanEditScript(itemID, UUID.Zero, remoteClient.AgentId)) |
184 | { | 184 | { |
185 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); | 185 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); |
186 | return UUID.Zero; | 186 | return UUID.Zero; |
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
243 | public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId, | 243 | public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId, |
244 | UUID primId, bool isScriptRunning, byte[] data) | 244 | UUID primId, bool isScriptRunning, byte[] data) |
245 | { | 245 | { |
246 | if (!ExternalChecks.ExternalChecksCanEditScript(itemId, primId, remoteClient.AgentId)) | 246 | if (!Permissions.CanEditScript(itemId, primId, remoteClient.AgentId)) |
247 | { | 247 | { |
248 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); | 248 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); |
249 | return; | 249 | return; |
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
432 | 432 | ||
433 | if (item != null) | 433 | if (item != null) |
434 | { | 434 | { |
435 | if (!ExternalChecks.ExternalChecksBypassPermissions()) | 435 | if (!Permissions.BypassPermissions()) |
436 | { | 436 | { |
437 | if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) | 437 | if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) |
438 | return null; | 438 | return null; |
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
458 | itemCopy.AssetType = item.AssetType; | 458 | itemCopy.AssetType = item.AssetType; |
459 | itemCopy.InvType = item.InvType; | 459 | itemCopy.InvType = item.InvType; |
460 | itemCopy.Folder = UUID.Zero; | 460 | itemCopy.Folder = UUID.Zero; |
461 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 461 | if (Permissions.PropagatePermissions()) |
462 | { | 462 | { |
463 | if (item.InvType == 6) | 463 | if (item.InvType == 6) |
464 | { | 464 | { |
@@ -500,7 +500,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
500 | 500 | ||
501 | recipientUserInfo.AddItem(itemCopy); | 501 | recipientUserInfo.AddItem(itemCopy); |
502 | 502 | ||
503 | if (!ExternalChecks.ExternalChecksBypassPermissions()) | 503 | if (!Permissions.BypassPermissions()) |
504 | { | 504 | { |
505 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 505 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
506 | senderUserInfo.DeleteItem(itemId); | 506 | senderUserInfo.DeleteItem(itemId); |
@@ -764,7 +764,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
764 | { | 764 | { |
765 | m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); | 765 | m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); |
766 | 766 | ||
767 | if (!ExternalChecks.ExternalChecksCanCreateUserInventory(invType, remoteClient.AgentId)) | 767 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) |
768 | return; | 768 | return; |
769 | 769 | ||
770 | if (transactionID == UUID.Zero) | 770 | if (transactionID == UUID.Zero) |
@@ -975,7 +975,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
975 | agentItem.InvType = taskItem.InvType; | 975 | agentItem.InvType = taskItem.InvType; |
976 | agentItem.Flags = taskItem.Flags; | 976 | agentItem.Flags = taskItem.Flags; |
977 | 977 | ||
978 | if ((destAgent != taskItem.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 978 | if ((destAgent != taskItem.OwnerID) && Permissions.PropagatePermissions()) |
979 | { | 979 | { |
980 | agentItem.BasePermissions = taskItem.NextPermissions; | 980 | agentItem.BasePermissions = taskItem.NextPermissions; |
981 | agentItem.CurrentPermissions = taskItem.NextPermissions | 8; | 981 | agentItem.CurrentPermissions = taskItem.NextPermissions | 8; |
@@ -992,7 +992,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
992 | agentItem.GroupPermissions = taskItem.GroupPermissions; | 992 | agentItem.GroupPermissions = taskItem.GroupPermissions; |
993 | } | 993 | } |
994 | 994 | ||
995 | if (!ExternalChecks.ExternalChecksBypassPermissions()) | 995 | if (!Permissions.BypassPermissions()) |
996 | { | 996 | { |
997 | if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 997 | if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
998 | part.Inventory.RemoveInventoryItem(itemId); | 998 | part.Inventory.RemoveInventoryItem(itemId); |
@@ -1165,7 +1165,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1165 | 1165 | ||
1166 | if (destPart.OwnerID != part.OwnerID) | 1166 | if (destPart.OwnerID != part.OwnerID) |
1167 | { | 1167 | { |
1168 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1168 | if (Permissions.PropagatePermissions()) |
1169 | { | 1169 | { |
1170 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & | 1170 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & |
1171 | srcTaskItem.NextPermissions; | 1171 | srcTaskItem.NextPermissions; |
@@ -1262,7 +1262,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1262 | // AllowInventoryDrop flag has been set. Don't however let | 1262 | // AllowInventoryDrop flag has been set. Don't however let |
1263 | // them update an item unless they pass the external checks | 1263 | // them update an item unless they pass the external checks |
1264 | // | 1264 | // |
1265 | if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId) | 1265 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId) |
1266 | && (currentItem != null || !allowInventoryDrop)) | 1266 | && (currentItem != null || !allowInventoryDrop)) |
1267 | return; | 1267 | return; |
1268 | 1268 | ||
@@ -1291,7 +1291,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1291 | "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", | 1291 | "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", |
1292 | item.Name, primLocalID, remoteClient.Name); | 1292 | item.Name, primLocalID, remoteClient.Name); |
1293 | part.GetProperties(remoteClient); | 1293 | part.GetProperties(remoteClient); |
1294 | if (!ExternalChecks.ExternalChecksBypassPermissions()) | 1294 | if (!Permissions.BypassPermissions()) |
1295 | { | 1295 | { |
1296 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1296 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1297 | RemoveInventoryItem(remoteClient, itemID); | 1297 | RemoveInventoryItem(remoteClient, itemID); |
@@ -1358,7 +1358,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1358 | SceneObjectPart part = GetSceneObjectPart(localID); | 1358 | SceneObjectPart part = GetSceneObjectPart(localID); |
1359 | if (part != null) | 1359 | if (part != null) |
1360 | { | 1360 | { |
1361 | if (!ExternalChecks.ExternalChecksCanEditObjectInventory(part.UUID, remoteClient.AgentId)) | 1361 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) |
1362 | return; | 1362 | return; |
1363 | 1363 | ||
1364 | part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID); | 1364 | part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID); |
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1400 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1400 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1401 | return; | 1401 | return; |
1402 | 1402 | ||
1403 | if (!ExternalChecks.ExternalChecksCanCreateObjectInventory( | 1403 | if (!Permissions.CanCreateObjectInventory( |
1404 | itemBase.InvType, part.UUID, remoteClient.AgentId)) | 1404 | itemBase.InvType, part.UUID, remoteClient.AgentId)) |
1405 | return; | 1405 | return; |
1406 | 1406 | ||
@@ -1506,7 +1506,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1506 | 1506 | ||
1507 | if (destPart.OwnerID != srcPart.OwnerID) | 1507 | if (destPart.OwnerID != srcPart.OwnerID) |
1508 | { | 1508 | { |
1509 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1509 | if (Permissions.PropagatePermissions()) |
1510 | { | 1510 | { |
1511 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & | 1511 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & |
1512 | srcTaskItem.NextPermissions; | 1512 | srcTaskItem.NextPermissions; |
@@ -1567,20 +1567,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
1567 | if (destination == 1) // Take Copy | 1567 | if (destination == 1) // Take Copy |
1568 | { | 1568 | { |
1569 | permissionToTake = | 1569 | permissionToTake = |
1570 | ExternalChecks.ExternalChecksCanTakeCopyObject( | 1570 | Permissions.CanTakeCopyObject( |
1571 | grp.UUID, | 1571 | grp.UUID, |
1572 | remoteClient.AgentId); | 1572 | remoteClient.AgentId); |
1573 | } | 1573 | } |
1574 | else if (destination == 5) // God take copy | 1574 | else if (destination == 5) // God take copy |
1575 | { | 1575 | { |
1576 | permissionToTake = | 1576 | permissionToTake = |
1577 | ExternalChecks.ExternalChecksCanBeGodLike( | 1577 | Permissions.IsGod( |
1578 | remoteClient.AgentId); | 1578 | remoteClient.AgentId); |
1579 | } | 1579 | } |
1580 | else if (destination == 4) // Take | 1580 | else if (destination == 4) // Take |
1581 | { | 1581 | { |
1582 | permissionToTake = | 1582 | permissionToTake = |
1583 | ExternalChecks.ExternalChecksCanTakeObject( | 1583 | Permissions.CanTakeObject( |
1584 | grp.UUID, | 1584 | grp.UUID, |
1585 | remoteClient.AgentId); | 1585 | remoteClient.AgentId); |
1586 | 1586 | ||
@@ -1590,11 +1590,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1590 | else if (destination == 6) //Delete | 1590 | else if (destination == 6) //Delete |
1591 | { | 1591 | { |
1592 | permissionToTake = | 1592 | permissionToTake = |
1593 | ExternalChecks.ExternalChecksCanDeleteObject( | 1593 | Permissions.CanDeleteObject( |
1594 | grp.UUID, | 1594 | grp.UUID, |
1595 | remoteClient.AgentId); | 1595 | remoteClient.AgentId); |
1596 | permissionToDelete = | 1596 | permissionToDelete = |
1597 | ExternalChecks.ExternalChecksCanDeleteObject( | 1597 | Permissions.CanDeleteObject( |
1598 | grp.UUID, | 1598 | grp.UUID, |
1599 | remoteClient.AgentId); | 1599 | remoteClient.AgentId); |
1600 | } | 1600 | } |
@@ -1603,11 +1603,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1603 | if (remoteClient != null) | 1603 | if (remoteClient != null) |
1604 | { | 1604 | { |
1605 | permissionToTake = | 1605 | permissionToTake = |
1606 | ExternalChecks.ExternalChecksCanDeleteObject( | 1606 | Permissions.CanDeleteObject( |
1607 | grp.UUID, | 1607 | grp.UUID, |
1608 | remoteClient.AgentId); | 1608 | remoteClient.AgentId); |
1609 | permissionToDelete = | 1609 | permissionToDelete = |
1610 | ExternalChecks.ExternalChecksCanDeleteObject( | 1610 | Permissions.CanDeleteObject( |
1611 | grp.UUID, | 1611 | grp.UUID, |
1612 | remoteClient.AgentId); | 1612 | remoteClient.AgentId); |
1613 | if (permissionToDelete) | 1613 | if (permissionToDelete) |
@@ -1722,7 +1722,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1722 | item.InvType = (int)InventoryType.Object; | 1722 | item.InvType = (int)InventoryType.Object; |
1723 | item.Folder = folderID; | 1723 | item.Folder = folderID; |
1724 | 1724 | ||
1725 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 1725 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) |
1726 | { | 1726 | { |
1727 | uint perms=objectGroup.GetEffectivePermissions(); | 1727 | uint perms=objectGroup.GetEffectivePermissions(); |
1728 | uint nextPerms=(perms & 7) << 13; | 1728 | uint nextPerms=(perms & 7) << 13; |
@@ -1877,7 +1877,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1877 | 1877 | ||
1878 | item.Folder = UUID.Zero; // Objects folder! | 1878 | item.Folder = UUID.Zero; // Objects folder! |
1879 | 1879 | ||
1880 | if ((remoteClient.AgentId != grp.RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 1880 | if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions()) |
1881 | { | 1881 | { |
1882 | item.BasePermissions = grp.RootPart.NextOwnerMask; | 1882 | item.BasePermissions = grp.RootPart.NextOwnerMask; |
1883 | item.CurrentPermissions = grp.RootPart.NextOwnerMask; | 1883 | item.CurrentPermissions = grp.RootPart.NextOwnerMask; |
@@ -1988,7 +1988,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1988 | { | 1988 | { |
1989 | string xmlData = Utils.BytesToString(rezAsset.Data); | 1989 | string xmlData = Utils.BytesToString(rezAsset.Data); |
1990 | SceneObjectGroup group = new SceneObjectGroup(xmlData, true); | 1990 | SceneObjectGroup group = new SceneObjectGroup(xmlData, true); |
1991 | if (!ExternalChecks.ExternalChecksCanRezObject( | 1991 | if (!Permissions.CanRezObject( |
1992 | group.Children.Count, remoteClient.AgentId, pos) | 1992 | group.Children.Count, remoteClient.AgentId, pos) |
1993 | && !attachment) | 1993 | && !attachment) |
1994 | { | 1994 | { |
@@ -2043,7 +2043,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2043 | rootPart.ObjectSaleType = 0; | 2043 | rootPart.ObjectSaleType = 0; |
2044 | rootPart.SalePrice = 10; | 2044 | rootPart.SalePrice = 10; |
2045 | 2045 | ||
2046 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 2046 | if (Permissions.PropagatePermissions()) |
2047 | { | 2047 | { |
2048 | if ((item.CurrentPermissions & 8) != 0) | 2048 | if ((item.CurrentPermissions & 8) != 0) |
2049 | { | 2049 | { |
@@ -2093,7 +2093,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2093 | if (!attachment) | 2093 | if (!attachment) |
2094 | rootPart.ScheduleFullUpdate(); | 2094 | rootPart.ScheduleFullUpdate(); |
2095 | 2095 | ||
2096 | if (!ExternalChecks.ExternalChecksBypassPermissions()) | 2096 | if (!Permissions.BypassPermissions()) |
2097 | { | 2097 | { |
2098 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 2098 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
2099 | userInfo.DeleteItem(item.ID); | 2099 | userInfo.DeleteItem(item.ID); |
@@ -2133,7 +2133,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2133 | string xmlData = Utils.BytesToString(rezAsset.Data); | 2133 | string xmlData = Utils.BytesToString(rezAsset.Data); |
2134 | SceneObjectGroup group = new SceneObjectGroup(xmlData, true); | 2134 | SceneObjectGroup group = new SceneObjectGroup(xmlData, true); |
2135 | 2135 | ||
2136 | if (!ExternalChecks.ExternalChecksCanRezObject(group.Children.Count, ownerID, pos)) | 2136 | if (!Permissions.CanRezObject(group.Children.Count, ownerID, pos)) |
2137 | { | 2137 | { |
2138 | return null; | 2138 | return null; |
2139 | } | 2139 | } |
@@ -2158,7 +2158,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2158 | 2158 | ||
2159 | if (rootPart.OwnerID != item.OwnerID) | 2159 | if (rootPart.OwnerID != item.OwnerID) |
2160 | { | 2160 | { |
2161 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 2161 | if (Permissions.PropagatePermissions()) |
2162 | { | 2162 | { |
2163 | if ((item.CurrentPermissions & 8) != 0) | 2163 | if ((item.CurrentPermissions & 8) != 0) |
2164 | { | 2164 | { |
@@ -2197,7 +2197,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2197 | group.CreateScriptInstances(param, true, DefaultScriptEngine, 2); | 2197 | group.CreateScriptInstances(param, true, DefaultScriptEngine, 2); |
2198 | rootPart.ScheduleFullUpdate(); | 2198 | rootPart.ScheduleFullUpdate(); |
2199 | 2199 | ||
2200 | if (!ExternalChecks.ExternalChecksBypassPermissions()) | 2200 | if (!Permissions.BypassPermissions()) |
2201 | { | 2201 | { |
2202 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 2202 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
2203 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); | 2203 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); |
@@ -2315,7 +2315,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2315 | ScenePresence presence; | 2315 | ScenePresence presence; |
2316 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2316 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2317 | { | 2317 | { |
2318 | if (!ExternalChecks.ExternalChecksCanRezObject(part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition)) | 2318 | if (!Permissions.CanRezObject(part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition)) |
2319 | return; | 2319 | return; |
2320 | 2320 | ||
2321 | presence.Appearance.DetachAttachment(itemID); | 2321 | presence.Appearance.DetachAttachment(itemID); |
@@ -2359,7 +2359,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2359 | 2359 | ||
2360 | void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List<uint> localIDs) | 2360 | void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List<uint> localIDs) |
2361 | { | 2361 | { |
2362 | if (!ExternalChecks.ExternalChecksCanBeGodLike(remoteClient.AgentId)) | 2362 | if (!Permissions.IsGod(remoteClient.AgentId)) |
2363 | return; | 2363 | return; |
2364 | 2364 | ||
2365 | foreach (uint localID in localIDs) | 2365 | foreach (uint localID in localIDs) |