aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorUbitUmarov2017-01-21 05:14:13 +0000
committerUbitUmarov2017-01-21 05:14:13 +0000
commit9d61df0887d05415513645790fe266d84b00fffe (patch)
tree06c2d38fd65533253709b6327ad3df92c9e112b7 /OpenSim/Region/CoreModules/World
parentchange the initialization point of SimwideArea (diff)
downloadopensim-SC-9d61df0887d05415513645790fe266d84b00fffe.zip
opensim-SC-9d61df0887d05415513645790fe266d84b00fffe.tar.gz
opensim-SC-9d61df0887d05415513645790fe266d84b00fffe.tar.bz2
opensim-SC-9d61df0887d05415513645790fe266d84b00fffe.tar.xz
fix CanObjectEntry and CanTerraformLand group permissions
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs63
1 files changed, 30 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 2275497..59da1c2 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -98,8 +98,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
98 private bool m_forceAdminModeAlwaysOn; 98 private bool m_forceAdminModeAlwaysOn;
99 private bool m_allowAdminActionsWithoutGodMode; 99 private bool m_allowAdminActionsWithoutGodMode;
100 100
101 private bool m_SimpleBuildPermissions = false;
102
103 /// <value> 101 /// <value>
104 /// The set of users that are allowed to create scripts. This is only active if permissions are not being 102 /// The set of users that are allowed to create scripts. This is only active if permissions are not being
105 /// bypassed. This overrides normal permissions. 103 /// bypassed. This overrides normal permissions.
@@ -185,8 +183,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
185 if(m_allowAdminActionsWithoutGodMode) 183 if(m_allowAdminActionsWithoutGodMode)
186 m_forceAdminModeAlwaysOn = false; 184 m_forceAdminModeAlwaysOn = false;
187 185
188 m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions",sections, false);
189
190 m_allowedScriptCreators 186 m_allowedScriptCreators
191 = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); 187 = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators);
192 m_allowedScriptEditors 188 m_allowedScriptEditors
@@ -1068,27 +1064,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1068 return false; 1064 return false;
1069 } 1065 }
1070 1066
1071 protected bool GenericParcelPermission(UUID user, ILandObject parcel, ulong groupPowers)
1072 {
1073 if (parcel.LandData.OwnerID == user)
1074 return true;
1075
1076 if ((parcel.LandData.GroupID != UUID.Zero) && IsGroupMember(parcel.LandData.GroupID, user, groupPowers))
1077 return true;
1078
1079 if (IsEstateManager(user))
1080 return true;
1081
1082 if (IsAdministrator(user))
1083 return true;
1084
1085 if (m_SimpleBuildPermissions &&
1086 (parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsInLandAccessList(user))
1087 return true;
1088
1089 return false;
1090 }
1091
1092 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager) 1067 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager)
1093 { 1068 {
1094 if (parcel.LandData.OwnerID == user) 1069 if (parcel.LandData.OwnerID == user)
@@ -1470,9 +1445,25 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1470 return true; 1445 return true;
1471 } 1446 }
1472 1447
1473 if (GenericParcelPermission(sog.OwnerID, parcel, 0)) 1448 UUID userID = sog.OwnerID;
1449 LandData landdata = parcel.LandData;
1450
1451 if (landdata.OwnerID == userID)
1452 return true;
1453
1454 if (IsAdministrator(userID))
1474 return true; 1455 return true;
1475 1456
1457 UUID landGroupID = landdata.GroupID;
1458 if (landGroupID != UUID.Zero)
1459 {
1460 if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowGroupObjectEntry)) != 0)
1461 return IsGroupMember(landGroupID, userID, 0);
1462
1463 if (landdata.IsGroupOwned && IsGroupMember(landGroupID, userID, (ulong)GroupPowers.AllowRez))
1464 return true;
1465 }
1466
1476 //Otherwise, false! 1467 //Otherwise, false!
1477 return false; 1468 return false;
1478 } 1469 }
@@ -1688,13 +1679,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1688 return true; 1679 return true;
1689 } 1680 }
1690 1681
1691 private bool CanTerraformLand(UUID user, Vector3 position, Scene requestFromScene) 1682 private bool CanTerraformLand(UUID userID, Vector3 position, Scene requestFromScene)
1692 { 1683 {
1693 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1684 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1694 if (m_bypassPermissions) return m_bypassPermissionsValue; 1685 if (m_bypassPermissions) return m_bypassPermissionsValue;
1695 1686
1696 // Estate override 1687 // Estate override
1697 if (GenericEstatePermission(user)) 1688 if (GenericEstatePermission(userID))
1698 return true; 1689 return true;
1699 1690
1700 float X = position.X; 1691 float X = position.X;
@@ -1712,13 +1703,19 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1712 ILandObject parcel = m_scene.LandChannel.GetLandObject(X, Y); 1703 ILandObject parcel = m_scene.LandChannel.GetLandObject(X, Y);
1713 if (parcel == null) 1704 if (parcel == null)
1714 return false; 1705 return false;
1715 1706
1716 // Others allowed to terraform? 1707 LandData landdata = parcel.LandData;
1717 if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowTerraform)) != 0) 1708 if (landdata == null)
1709 return false;
1710
1711 if ((landdata.Flags & ((int)ParcelFlags.AllowTerraform)) != 0)
1718 return true; 1712 return true;
1719 1713
1720 // Land owner can terraform too 1714 if(landdata.OwnerID == userID)
1721 if (parcel != null && GenericParcelPermission(user, parcel, (ulong)GroupPowers.AllowEditLand)) 1715 return true;
1716
1717 if (landdata.IsGroupOwned && parcel.LandData.GroupID != UUID.Zero &&
1718 IsGroupMember(landdata.GroupID, userID, (ulong)GroupPowers.AllowEditLand))
1722 return true; 1719 return true;
1723 1720
1724 return false; 1721 return false;