add more calls to effective permissions aggregation; do not change groupmask on deed

UbitUmarov [2017-01-17 01:22:44]
add more calls to effective permissions aggregation; do not change groupmask on deed
Filename
OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index b37744d..6783ce0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -1180,6 +1180,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
                                 part.NextOwnerMask = item.NextPermissions & part.BaseMask;
                             }
                         }
+
                     }
                 }
                 else
@@ -1198,6 +1199,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
                 }

                 rootPart.TrimPermissions();
+                so.AggregateDeepPerms();

                 if (isAttachment)
                     so.FromItemID = item.ID;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index ea100ae..c913271 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2754,9 +2754,16 @@ namespace OpenSim.Region.Framework.Scenes
                         continue;

                     sog.SetOwnerId(groupID);
-                    // Make the group mask be the previous owner mask
-                    sog.RootPart.GroupMask = sog.RootPart.OwnerMask;
+
+                    // this is wrong, GroupMask is used for group sharing, still possible to set
+                    // this whould give owner rights to users that are member of group but don't have role powers to edit
+//                    sog.RootPart.GroupMask = sog.RootPart.OwnerMask;
+
+                    // we should keep all permissions on deed to group
+                    // and with this comented code, if user does not set next permissions on the object
+                    // and on ALL contents of ALL prims, he may loose rights, making the object useless
                     sog.ApplyNextOwnerPermissions();
+                    sog.AggregatePerms();

                     sog.ScheduleGroupForFullUpdate();

diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 639c8dd..033170d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2764,7 +2764,10 @@ namespace OpenSim.Region.Framework.Scenes
             {
                 // Apply Next Owner Permissions if we're not bypassing permissions
                 if (!m_scene.Permissions.BypassPermissions())
+                {
                     ApplyNextOwnerPermissions();
+                    AggregatePerms();
+                }
             }

             rpart.ScheduleFullUpdate();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 4dd8eb1..29d9f08 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -980,6 +980,7 @@ namespace OpenSim.Region.Framework.Scenes
                 }
 // old code end
                 rootPart.TrimPermissions();
+                group.AggregateDeepPerms();
             }

             return true;
ViewGit