aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2017-01-19 17:45:54 +0000
committerUbitUmarov2017-01-19 17:45:54 +0000
commitd8108ab740d9a6ad782476fc43b62ec4c36b30b3 (patch)
tree6b4c53cd221ede82abc40b3eda6f0608f827f586 /OpenSim/Region/CoreModules
parentadd a comment about parts permissions aggregation (diff)
downloadopensim-SC_OLD-d8108ab740d9a6ad782476fc43b62ec4c36b30b3.zip
opensim-SC_OLD-d8108ab740d9a6ad782476fc43b62ec4c36b30b3.tar.gz
opensim-SC_OLD-d8108ab740d9a6ad782476fc43b62ec4c36b30b3.tar.bz2
opensim-SC_OLD-d8108ab740d9a6ad782476fc43b62ec4c36b30b3.tar.xz
change CanDeedObject. WARNING like on other grids, if you do not set next owner rights on object and ALL ITS CONTENTS, you may loose all rights on it
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs41
1 files changed, 31 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 1c8d4b8..b4c5072 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -71,12 +71,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
71 #region Constants 71 #region Constants
72 // These are here for testing. They will be taken out 72 // These are here for testing. They will be taken out
73 73
74 //private uint PERM_ALL = (uint)2147483647;
75 private uint PERM_COPY = (uint)32768;
76 //private uint PERM_MODIFY = (uint)16384;
77 private uint PERM_MOVE = (uint)524288;
78 private uint PERM_TRANS = (uint)8192;
79// private uint PERM_LOCKED = (uint)540672;
80 private uint PERM_LOCKED = (uint)524288; // same as move 74 private uint PERM_LOCKED = (uint)524288; // same as move
81 75
82 /// <value> 76 /// <value>
@@ -867,6 +861,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
867 return PermissionClass.Everyone; 861 return PermissionClass.Everyone;
868 } 862 }
869 863
864 // get effective object permissions using user UUID. User rights will be fixed
870 protected uint GetObjectPermissions(UUID currentUser, SceneObjectGroup group, bool denyOnLocked) 865 protected uint GetObjectPermissions(UUID currentUser, SceneObjectGroup group, bool denyOnLocked)
871 { 866 {
872 if (group == null) 867 if (group == null)
@@ -918,6 +913,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
918 return group.EffectiveEveryOnePerms & lockmask; 913 return group.EffectiveEveryOnePerms & lockmask;
919 } 914 }
920 915
916 // get effective object permissions using present presence. So some may depend on requested rights (ie God)
921 protected uint GetObjectPermissions(ScenePresence sp, SceneObjectGroup group, bool denyOnLocked) 917 protected uint GetObjectPermissions(ScenePresence sp, SceneObjectGroup group, bool denyOnLocked)
922 { 918 {
923 if (sp == null || sp.IsDeleted || group == null || group.IsDeleted) 919 if (sp == null || sp.IsDeleted || group == null || group.IsDeleted)
@@ -1178,15 +1174,40 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1178 return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDeed, false); 1174 return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDeed, false);
1179 } 1175 }
1180 1176
1181 private bool CanDeedObject(UUID user, UUID group, Scene scene) 1177 private bool CanDeedObject(ScenePresence sp, SceneObjectGroup sog, UUID targetGroupID)
1182 { 1178 {
1183 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1179 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1184 if (m_bypassPermissions) return m_bypassPermissionsValue; 1180 if (m_bypassPermissions) return m_bypassPermissionsValue;
1185 1181
1186 ScenePresence sp = scene.GetScenePresence(user); 1182 if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted || targetGroupID == UUID.Zero)
1187 IClientAPI client = sp.ControllingClient; 1183 return false;
1184
1185 // object has group already?
1186 if(sog.GroupID != targetGroupID)
1187 return false;
1188
1189 // is effectivelly shared?
1190 if(sog.EffectiveGroupPerms == 0)
1191 return false;
1192
1193 if(sp.IsGod)
1194 return true;
1195
1196 // owned by requester?
1197 if(sog.OwnerID != sp.UUID)
1198 return false;
1199
1200 // owner can transfer?
1201 if((sog.EffectiveOwnerPerms & (uint)PermissionMask.Transfer) == 0)
1202 return false;
1203
1204 // group member ?
1205 ulong powers = 0;
1206 if(!GroupMemberPowers(targetGroupID, sp, ref powers))
1207 return false;
1188 1208
1189 if ((client.GetGroupPowers(group) & (ulong)GroupPowers.DeedObject) == 0) 1209 // has group rights?
1210 if ((powers & (ulong)GroupPowers.DeedObject) == 0)
1190 return false; 1211 return false;
1191 1212
1192 return true; 1213 return true;