aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs84
1 files changed, 42 insertions, 42 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index f360577..040d0a3 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
103 //private uint PERM_MODIFY = (uint)16384; 103 //private uint PERM_MODIFY = (uint)16384;
104 private uint PERM_MOVE = (uint)524288; 104 private uint PERM_MOVE = (uint)524288;
105 private uint PERM_TRANS = (uint)8192; 105 private uint PERM_TRANS = (uint)8192;
106 private uint PERM_LOCKED = (uint)540672; 106 private uint PERM_LOCKED = (uint)540672;
107 107
108 /// <value> 108 /// <value>
109 /// Different user set names that come in from the configuration file. 109 /// Different user set names that come in from the configuration file.
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
114 Administrators 114 Administrators
115 }; 115 };
116 116
117 #endregion 117 #endregion
118 118
119 #region Bypass Permissions / Debug Permissions Stuff 119 #region Bypass Permissions / Debug Permissions Stuff
120 120
@@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
136 /// <value> 136 /// <value>
137 /// The set of users that are allowed to edit (save) scripts. This is only active if 137 /// The set of users that are allowed to edit (save) scripts. This is only active if
138 /// permissions are not being bypassed. This overrides normal permissions.- 138 /// permissions are not being bypassed. This overrides normal permissions.-
139 /// </value> 139 /// </value>
140 private UserSet m_allowedScriptEditors = UserSet.All; 140 private UserSet m_allowedScriptEditors = UserSet.All;
141 141
142 private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>(); 142 private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>();
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
190 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; 190 m_scene.Permissions.OnDuplicateObject += CanDuplicateObject;
191 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED 191 m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED
192 m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED 192 m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED
193 m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED 193 m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED
194 m_scene.Permissions.OnInstantMessage += CanInstantMessage; 194 m_scene.Permissions.OnInstantMessage += CanInstantMessage;
195 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED 195 m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED
196 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED 196 m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED
@@ -210,12 +210,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
210 m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED 210 m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED
211 211
212 m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED 212 m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED
213 m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED 213 m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED
214 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED 214 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED
215 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED 215 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED
216 216
217 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE 217 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE
218 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED 218 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED
219 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED 219 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED
220 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED 220 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED
221 m_scene.Permissions.OnResetScript += CanResetScript; 221 m_scene.Permissions.OnResetScript += CanResetScript;
@@ -249,7 +249,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
249 foreach (string uuidl in grant.Split(',')) { 249 foreach (string uuidl in grant.Split(',')) {
250 string uuid = uuidl.Trim(" \t".ToCharArray()); 250 string uuid = uuidl.Trim(" \t".ToCharArray());
251 GrantLSL.Add(uuid, true); 251 GrantLSL.Add(uuid, true);
252 } 252 }
253 } 253 }
254 254
255 grant = myConfig.GetString("GrantCS",""); 255 grant = myConfig.GetString("GrantCS","");
@@ -431,7 +431,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
431 m_log.ErrorFormat( 431 m_log.ErrorFormat(
432 "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", 432 "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}",
433 rawSetting, settingName, userSet); 433 rawSetting, settingName, userSet);
434 } 434 }
435 435
436 m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); 436 m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet);
437 437
@@ -569,7 +569,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
569 569
570 // Users should be able to edit what is over their land. 570 // Users should be able to edit what is over their land.
571 ILandObject parcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); 571 ILandObject parcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y);
572 if (parcel != null && parcel.landData.OwnerID == user && m_ParcelOwnerIsGod) 572 if (parcel != null && parcel.LandData.OwnerID == user && m_ParcelOwnerIsGod)
573 { 573 {
574 // Admin objects should not be editable by the above 574 // Admin objects should not be editable by the above
575 if (!IsAdministrator(objectOwner)) 575 if (!IsAdministrator(objectOwner))
@@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
672 672
673 // Users should be able to edit what is over their land. 673 // Users should be able to edit what is over their land.
674 ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); 674 ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y);
675 if ((parcel != null) && (parcel.landData.OwnerID == currentUser)) 675 if ((parcel != null) && (parcel.LandData.OwnerID == currentUser))
676 { 676 {
677 permission = true; 677 permission = true;
678 } 678 }
@@ -740,12 +740,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
740 { 740 {
741 bool permission = false; 741 bool permission = false;
742 742
743 if (parcel.landData.OwnerID == user) 743 if (parcel.LandData.OwnerID == user)
744 { 744 {
745 permission = true; 745 permission = true;
746 } 746 }
747 747
748 if ((parcel.landData.GroupID != UUID.Zero) && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) 748 if ((parcel.LandData.GroupID != UUID.Zero) && IsGroupMember(parcel.LandData.GroupID, user, groupPowers))
749 { 749 {
750 permission = true; 750 permission = true;
751 } 751 }
@@ -767,12 +767,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
767 { 767 {
768 bool permission = false; 768 bool permission = false;
769 769
770 if (parcel.landData.OwnerID == user) 770 if (parcel.LandData.OwnerID == user)
771 { 771 {
772 permission = true; 772 permission = true;
773 } 773 }
774 774
775 if (parcel.landData.IsGroupOwned && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) 775 if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers))
776 { 776 {
777 permission = true; 777 permission = true;
778 } 778 }
@@ -820,13 +820,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
820 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 820 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
821 if (m_bypassPermissions) return m_bypassPermissionsValue; 821 if (m_bypassPermissions) return m_bypassPermissionsValue;
822 822
823 if (parcel.landData.OwnerID != user) // Only the owner can deed! 823 if (parcel.LandData.OwnerID != user) // Only the owner can deed!
824 return false; 824 return false;
825 825
826 ScenePresence sp = scene.GetScenePresence(user); 826 ScenePresence sp = scene.GetScenePresence(user);
827 IClientAPI client = sp.ControllingClient; 827 IClientAPI client = sp.ControllingClient;
828 828
829 if ((client.GetGroupPowers(parcel.landData.GroupID) & (ulong)GroupPowers.LandDeed) == 0) 829 if ((client.GetGroupPowers(parcel.LandData.GroupID) & (ulong)GroupPowers.LandDeed) == 0)
830 return false; 830 return false;
831 831
832 return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDeed); 832 return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDeed);
@@ -942,7 +942,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
942 if (m_bypassPermissions) return m_bypassPermissionsValue; 942 if (m_bypassPermissions) return m_bypassPermissionsValue;
943 943
944 if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) 944 if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user))
945 return false; 945 return false;
946 946
947 // Ordinarily, if you can view it, you can edit it 947 // Ordinarily, if you can view it, you can edit it
948 // There is no viewing a no mod script 948 // There is no viewing a no mod script
@@ -957,7 +957,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
957 /// <param name="objectID"></param> 957 /// <param name="objectID"></param>
958 /// <param name="user"></param> 958 /// <param name="user"></param>
959 /// <param name="scene"></param> 959 /// <param name="scene"></param>
960 /// <returns></returns> 960 /// <returns></returns>
961 private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) 961 private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene)
962 { 962 {
963 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 963 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -1189,7 +1189,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1189 return false; 1189 return false;
1190 } 1190 }
1191 1191
1192 if ((land.landData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0) 1192 if ((land.LandData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0)
1193 { 1193 {
1194 return true; 1194 return true;
1195 } 1195 }
@@ -1233,7 +1233,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1233 ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); 1233 ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y);
1234 if (land == null) return false; 1234 if (land == null) return false;
1235 1235
1236 if ((land.landData.Flags & ((int)ParcelFlags.CreateObjects)) == 1236 if ((land.LandData.Flags & ((int)ParcelFlags.CreateObjects)) ==
1237 (int)ParcelFlags.CreateObjects) 1237 (int)ParcelFlags.CreateObjects)
1238 permission = true; 1238 permission = true;
1239 1239
@@ -1360,7 +1360,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1360 return false; 1360 return false;
1361 1361
1362 // Others allowed to terraform? 1362 // Others allowed to terraform?
1363 if ((parcel.landData.Flags & ((int)ParcelFlags.AllowTerraform)) != 0) 1363 if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowTerraform)) != 0)
1364 return true; 1364 return true;
1365 1365
1366 // Land owner can terraform too 1366 // Land owner can terraform too
@@ -1377,11 +1377,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1377 /// <param name="objectID"></param> 1377 /// <param name="objectID"></param>
1378 /// <param name="user"></param> 1378 /// <param name="user"></param>
1379 /// <param name="scene"></param> 1379 /// <param name="scene"></param>
1380 /// <returns></returns> 1380 /// <returns></returns>
1381 private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene) 1381 private bool CanViewScript(UUID script, UUID objectID, UUID user, Scene scene)
1382 { 1382 {
1383 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1383 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1384 if (m_bypassPermissions) return m_bypassPermissionsValue; 1384 if (m_bypassPermissions) return m_bypassPermissionsValue;
1385 1385
1386 if (objectID == UUID.Zero) // User inventory 1386 if (objectID == UUID.Zero) // User inventory
1387 { 1387 {
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1472 /// <param name="objectID"></param> 1472 /// <param name="objectID"></param>
1473 /// <param name="user"></param> 1473 /// <param name="user"></param>
1474 /// <param name="scene"></param> 1474 /// <param name="scene"></param>
1475 /// <returns></returns> 1475 /// <returns></returns>
1476 private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) 1476 private bool CanViewNotecard(UUID notecard, UUID objectID, UUID user, Scene scene)
1477 { 1477 {
1478 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1478 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -1609,7 +1609,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1609 /// </summary> 1609 /// </summary>
1610 /// <param name="invType"></param> 1610 /// <param name="invType"></param>
1611 /// <param name="userID"></param> 1611 /// <param name="userID"></param>
1612 /// <returns></returns> 1612 /// <returns></returns>
1613 private bool CanCreateUserInventory(int invType, UUID userID) 1613 private bool CanCreateUserInventory(int invType, UUID userID)
1614 { 1614 {
1615 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1615 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -1619,7 +1619,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1619 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) 1619 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID))
1620 return false; 1620 return false;
1621 1621
1622 return true; 1622 return true;
1623 } 1623 }
1624 1624
1625 /// <summary> 1625 /// <summary>
@@ -1627,27 +1627,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1627 /// </summary> 1627 /// </summary>
1628 /// <param name="itemID"></param> 1628 /// <param name="itemID"></param>
1629 /// <param name="userID"></param> 1629 /// <param name="userID"></param>
1630 /// <returns></returns> 1630 /// <returns></returns>
1631 private bool CanCopyUserInventory(UUID itemID, UUID userID) 1631 private bool CanCopyUserInventory(UUID itemID, UUID userID)
1632 { 1632 {
1633 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1633 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1634 if (m_bypassPermissions) return m_bypassPermissionsValue; 1634 if (m_bypassPermissions) return m_bypassPermissionsValue;
1635 1635
1636 return true; 1636 return true;
1637 } 1637 }
1638 1638
1639 /// <summary> 1639 /// <summary>
1640 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. 1640 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory.
1641 /// </summary> 1641 /// </summary>
1642 /// <param name="itemID"></param> 1642 /// <param name="itemID"></param>
1643 /// <param name="userID"></param> 1643 /// <param name="userID"></param>
1644 /// <returns></returns> 1644 /// <returns></returns>
1645 private bool CanEditUserInventory(UUID itemID, UUID userID) 1645 private bool CanEditUserInventory(UUID itemID, UUID userID)
1646 { 1646 {
1647 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1647 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1648 if (m_bypassPermissions) return m_bypassPermissionsValue; 1648 if (m_bypassPermissions) return m_bypassPermissionsValue;
1649 1649
1650 return true; 1650 return true;
1651 } 1651 }
1652 1652
1653 /// <summary> 1653 /// <summary>
@@ -1655,14 +1655,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1655 /// </summary> 1655 /// </summary>
1656 /// <param name="itemID"></param> 1656 /// <param name="itemID"></param>
1657 /// <param name="userID"></param> 1657 /// <param name="userID"></param>
1658 /// <returns></returns> 1658 /// <returns></returns>
1659 private bool CanDeleteUserInventory(UUID itemID, UUID userID) 1659 private bool CanDeleteUserInventory(UUID itemID, UUID userID)
1660 { 1660 {
1661 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1661 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1662 if (m_bypassPermissions) return m_bypassPermissionsValue; 1662 if (m_bypassPermissions) return m_bypassPermissionsValue;
1663 1663
1664 return true; 1664 return true;
1665 } 1665 }
1666 1666
1667 private bool CanTeleport(UUID userID, Scene scene) 1667 private bool CanTeleport(UUID userID, Scene scene)
1668 { 1668 {
@@ -1693,27 +1693,27 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1693 if (m_bypassPermissions) return m_bypassPermissionsValue; 1693 if (m_bypassPermissions) return m_bypassPermissionsValue;
1694 1694
1695 long powers = 0; 1695 long powers = 0;
1696 if (parcel.landData.GroupID != UUID.Zero) 1696 if (parcel.LandData.GroupID != UUID.Zero)
1697 client.GetGroupPowers(parcel.landData.GroupID); 1697 client.GetGroupPowers(parcel.LandData.GroupID);
1698 1698
1699 switch (type) 1699 switch (type)
1700 { 1700 {
1701 case (uint)ObjectReturnType.Owner: 1701 case (uint)ObjectReturnType.Owner:
1702 // Don't let group members return owner's objects, ever 1702 // Don't let group members return owner's objects, ever
1703 // 1703 //
1704 if (parcel.landData.IsGroupOwned) 1704 if (parcel.LandData.IsGroupOwned)
1705 { 1705 {
1706 if ((powers & (long)GroupPowers.ReturnGroupOwned) != 0) 1706 if ((powers & (long)GroupPowers.ReturnGroupOwned) != 0)
1707 return true; 1707 return true;
1708 } 1708 }
1709 else 1709 else
1710 { 1710 {
1711 if (parcel.landData.OwnerID != client.AgentId) 1711 if (parcel.LandData.OwnerID != client.AgentId)
1712 return false; 1712 return false;
1713 } 1713 }
1714 return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnGroupOwned); 1714 return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnGroupOwned);
1715 case (uint)ObjectReturnType.Group: 1715 case (uint)ObjectReturnType.Group:
1716 if (parcel.landData.OwnerID != client.AgentId) 1716 if (parcel.LandData.OwnerID != client.AgentId)
1717 { 1717 {
1718 // If permissionis granted through a group... 1718 // If permissionis granted through a group...
1719 // 1719 //