aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authormingchen2008-05-13 16:22:57 +0000
committermingchen2008-05-13 16:22:57 +0000
commit32785921d0a4a074b92da0f4ec322cf451a4642f (patch)
treeae93cc8fb09a5d7b991e323617e3324042e30a8d /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parent* Remove old historical grid inventory code (diff)
downloadopensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.zip
opensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.gz
opensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.bz2
opensim-SC-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.xz
*Complete redo of the permissions module
*Removed hardcoded permissions checks *Added permissions checks where needed
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs30
1 files changed, 20 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 782d5b4..cbb3a7d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -988,17 +988,28 @@ namespace OpenSim.Region.Environment.Scenes
988 } 988 }
989 if (selectedEnt != null) 989 if (selectedEnt != null)
990 { 990 {
991 bool permission; 991 bool permissionToTake = false;
992 if (DeRezPacket.AgentBlock.Destination == 1) 992 bool permissionToDelete = false;
993 { // Take Copy 993 if (DeRezPacket.AgentBlock.Destination == 1)// Take Copy
994 permission = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId); 994 {
995 permissionToTake = ExternalChecks.ExternalChecksCanTakeCopyObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
996 permissionToDelete = false; //Just taking copy!
997
995 } 998 }
996 else 999 else if(DeRezPacket.AgentBlock.Destination == 4) //Take
997 { // Take 1000 {
998 permission = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId); 1001 // Take
1002 permissionToTake = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
1003 permissionToDelete = permissionToTake; //If they can take, they can delete!
1004 }
1005
1006 else if (DeRezPacket.AgentBlock.Destination == 6) //Delete
1007 {
1008 permissionToTake = false;
1009 permissionToDelete = ExternalChecks.ExternalChecksCanDeleteObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId);
999 } 1010 }
1000 1011
1001 if (permission) 1012 if (permissionToTake)
1002 { 1013 {
1003 SceneObjectGroup objectGroup = (SceneObjectGroup) selectedEnt; 1014 SceneObjectGroup objectGroup = (SceneObjectGroup) selectedEnt;
1004 string sceneObjectXml = objectGroup.ToXmlString(); 1015 string sceneObjectXml = objectGroup.ToXmlString();
@@ -1044,8 +1055,7 @@ namespace OpenSim.Region.Environment.Scenes
1044 remoteClient.SendInventoryItemCreateUpdate(item); 1055 remoteClient.SendInventoryItemCreateUpdate(item);
1045 } 1056 }
1046 1057
1047 // FIXME: Nasty hardcoding. If Destination is 1 then client wants us to take a copy 1058 if (permissionToDelete)
1048 if (DeRezPacket.AgentBlock.Destination != 1)
1049 { 1059 {
1050 DeleteSceneObjectGroup(objectGroup); 1060 DeleteSceneObjectGroup(objectGroup);
1051 } 1061 }