aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Land
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/Modules/World/Land
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/Modules/World/Land')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs17
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs82
3 files changed, 65 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
index 2a28283..b5d5e6e 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
@@ -400,7 +400,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
400 400
401 //If we are still here, then they are subdividing within one piece of land 401 //If we are still here, then they are subdividing within one piece of land
402 //Check owner 402 //Check owner
403 if (startLandObject.landData.ownerID != attempting_user_id) 403 if (!m_scene.ExternalChecks.ExternalChecksCanEditParcel(attempting_user_id,startLandObject))
404 { 404 {
405 return; 405 return;
406 } 406 }
@@ -469,7 +469,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
469 { 469 {
470 return; 470 return;
471 } 471 }
472 if (masterLandObject.landData.ownerID != attempting_user_id) 472 if (!m_scene.ExternalChecks.ExternalChecksCanEditParcel(attempting_user_id, masterLandObject))
473 { 473 {
474 return; 474 return;
475 } 475 }
@@ -655,6 +655,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
655 655
656 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) 656 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
657 { 657 {
658
658 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); 659 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client);
659 } 660 }
660 661
@@ -663,6 +664,18 @@ namespace OpenSim.Region.Environment.Modules.World.Land
663 landList[local_id].sendLandObjectOwners(remote_client); 664 landList[local_id].sendLandObjectOwners(remote_client);
664 } 665 }
665 666
667 public void handleParcelAbandonRequest(int local_id, IClientAPI remote_client)
668 {
669 if (landList.ContainsKey(local_id))
670 {
671 if (m_scene.ExternalChecks.ExternalChecksCanAbandonParcel(remote_client.AgentId, landList[local_id]))
672 {
673 landList[local_id].landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
674 m_scene.Broadcast(SendParcelOverlay);
675 }
676 }
677
678 }
666 #endregion 679 #endregion
667 680
668 #region ILandChannel Members 681 #region ILandChannel Members
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
index a339ebf..2719a20 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
@@ -52,7 +52,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
52 m_scene.EventManager.OnLandBuy += landChannel.handleLandBuyRequest; 52 m_scene.EventManager.OnLandBuy += landChannel.handleLandBuyRequest;
53 m_scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient); 53 m_scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient);
54 m_scene.EventManager.OnSignificantClientMovement += landChannel.handleSignificantClientMovement; 54 m_scene.EventManager.OnSignificantClientMovement += landChannel.handleSignificantClientMovement;
55
56 lock (m_scene) 55 lock (m_scene)
57 { 56 {
58 m_scene.LandChannel = (ILandChannel) landChannel; 57 m_scene.LandChannel = (ILandChannel) landChannel;
@@ -70,8 +69,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land
70 client.OnParcelObjectOwnerRequest += new ParcelObjectOwnerRequest(landChannel.handleParcelObjectOwnersRequest); 69 client.OnParcelObjectOwnerRequest += new ParcelObjectOwnerRequest(landChannel.handleParcelObjectOwnersRequest);
71 client.OnParcelAccessListRequest += new ParcelAccessListRequest(landChannel.handleParcelAccessRequest); 70 client.OnParcelAccessListRequest += new ParcelAccessListRequest(landChannel.handleParcelAccessRequest);
72 client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(landChannel.handleParcelAccessUpdateRequest); 71 client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(landChannel.handleParcelAccessUpdateRequest);
72 client.OnParcelAbandonRequest += new ParcelAbandonRequest(landChannel.handleParcelAbandonRequest);
73 } 73 }
74 74
75
76
75 public void PostInitialise() 77 public void PostInitialise()
76 { 78 {
77 } 79 }
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index 2d3359c..0236e5f 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -127,12 +127,19 @@ namespace OpenSim.Region.Environment.Modules.World.Land
127 127
128 public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) 128 public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
129 { 129 {
130 if (remote_client.AgentId == landData.ownerID) 130 if (m_scene.ExternalChecks.ExternalChecksCanEditParcel(remote_client.AgentId,this))
131 { 131 {
132 //Needs later group support 132 //Needs later group support
133 LandData newData = landData.Copy(); 133 LandData newData = landData.Copy();
134 134
135 newData.authBuyerID = args.AuthBuyerID; 135 if (args.AuthBuyerID != newData.authBuyerID || args.SalePrice != newData.salePrice)
136 {
137 if (m_scene.ExternalChecks.ExternalChecksCanSellParcel(remote_client.AgentId, this))
138 {
139 newData.authBuyerID = args.AuthBuyerID;
140 newData.salePrice = args.SalePrice;
141 }
142 }
136 newData.category = args.Category; 143 newData.category = args.Category;
137 newData.landDesc = args.Desc; 144 newData.landDesc = args.Desc;
138 newData.groupID = args.GroupID; 145 newData.groupID = args.GroupID;
@@ -145,7 +152,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
145 newData.landFlags = args.ParcelFlags; 152 newData.landFlags = args.ParcelFlags;
146 newData.passHours = args.PassHours; 153 newData.passHours = args.PassHours;
147 newData.passPrice = args.PassPrice; 154 newData.passPrice = args.PassPrice;
148 newData.salePrice = args.SalePrice;
149 newData.snapshotID = args.SnapshotID; 155 newData.snapshotID = args.SnapshotID;
150 newData.userLocation = args.UserLocation; 156 newData.userLocation = args.UserLocation;
151 newData.userLookAt = args.UserLookAt; 157 newData.userLookAt = args.UserLookAt;
@@ -587,27 +593,30 @@ namespace OpenSim.Region.Environment.Modules.World.Land
587 593
588 public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client) 594 public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client)
589 { 595 {
590 List<uint> resultLocalIDs = new List<uint>(); 596 if (m_scene.ExternalChecks.ExternalChecksCanEditParcel(remote_client.AgentId, this))
591 foreach (SceneObjectGroup obj in primsOverMe)
592 { 597 {
593 if (obj.LocalId > 0) 598 List<uint> resultLocalIDs = new List<uint>();
599 foreach (SceneObjectGroup obj in primsOverMe)
594 { 600 {
595 if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.ownerID) 601 if (obj.LocalId > 0)
596 { 602 {
597 resultLocalIDs.Add(obj.LocalId); 603 if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.ownerID)
598 } 604 {
605 resultLocalIDs.Add(obj.LocalId);
606 }
599 // else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && ...) // TODO: group support 607 // else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && ...) // TODO: group support
600 // { 608 // {
601 // } 609 // }
602 else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER && 610 else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER &&
603 obj.OwnerID != remote_client.AgentId) 611 obj.OwnerID != remote_client.AgentId)
604 { 612 {
605 resultLocalIDs.Add(obj.LocalId); 613 resultLocalIDs.Add(obj.LocalId);
614 }
606 } 615 }
607 } 616 }
608 }
609 617
610 remote_client.sendForceClientSelectObjects(resultLocalIDs); 618 remote_client.sendForceClientSelectObjects(resultLocalIDs);
619 }
611 } 620 }
612 621
613 /// <summary> 622 /// <summary>
@@ -620,32 +629,35 @@ namespace OpenSim.Region.Environment.Modules.World.Land
620 /// </param> 629 /// </param>
621 public void sendLandObjectOwners(IClientAPI remote_client) 630 public void sendLandObjectOwners(IClientAPI remote_client)
622 { 631 {
623 Dictionary<LLUUID, int> primCount = new Dictionary<LLUUID, int>(); 632 if (m_scene.ExternalChecks.ExternalChecksCanEditParcel(remote_client.AgentId, this))
624
625 foreach (SceneObjectGroup obj in primsOverMe)
626 { 633 {
627 try 634 Dictionary<LLUUID, int> primCount = new Dictionary<LLUUID, int>();
635
636 foreach (SceneObjectGroup obj in primsOverMe)
628 { 637 {
629 if (!primCount.ContainsKey(obj.OwnerID)) 638 try
630 { 639 {
631 primCount.Add(obj.OwnerID, 0); 640 if (!primCount.ContainsKey(obj.OwnerID))
641 {
642 primCount.Add(obj.OwnerID, 0);
643 }
644 }
645 catch (NullReferenceException)
646 {
647 m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel");
648 }
649 try
650 {
651 primCount[obj.OwnerID] += obj.PrimCount;
652 }
653 catch (KeyNotFoundException)
654 {
655 m_log.Error("[LAND]: Unable to match a prim with it's owner.");
632 } 656 }
633 } 657 }
634 catch (NullReferenceException)
635 {
636 m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel");
637 }
638 try
639 {
640 primCount[obj.OwnerID] += obj.PrimCount;
641 }
642 catch (KeyNotFoundException)
643 {
644 m_log.Error("[LAND]: Unable to match a prim with it's owner.");
645 }
646 }
647 658
648 remote_client.sendLandObjectOwners(primCount); 659 remote_client.sendLandObjectOwners(primCount);
660 }
649 } 661 }
650 662
651 public Dictionary<LLUUID, int> getLandObjectOwners() 663 public Dictionary<LLUUID, int> getLandObjectOwners()