diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 696b0ef525..c949c04194 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -242,7 +242,7 @@ namespace OpenSim.Framework
public delegate void CreateNewInventoryItem(
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
- sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate);
+ sbyte invType, sbyte type, byte wearableType, uint everyoneMask, int creationDate);
public delegate void LinkInventoryItem(
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 49a708b1a0..d4a929c611 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
///
public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID,
uint callbackID, string description, string name, sbyte invType,
- sbyte assetType,
- byte wearableType, uint nextOwnerMask, int creationDate)
+ sbyte assetType, byte wearableType,
+ uint nextOwnerMask, int creationDate)
{
m_log.DebugFormat("[INVENTORY ACCESS MODULE]: Received request to create inventory item {0} in folder {1}, transactionID {2}", name,
folderID, transactionID);
@@ -220,7 +220,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_Scene.AssetService.Store(asset);
m_Scene.CreateNewInventoryItem(
remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
- name, description, 0, callbackID, asset.FullID, asset.Type, invType, nextOwnerMask, creationDate);
+ name, description, 0, callbackID, asset.FullID, asset.Type, invType,
+ (uint)PermissionMask.All | (uint)PermissionMask.Export, // Base
+ (uint)PermissionMask.All | (uint)PermissionMask.Export, // Current
+ 0, nextOwnerMask, 0, creationDate, false); // Data from viewer
}
else
{
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a28737e24e..b77b860ed8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -979,32 +979,6 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + remoteClient.AgentId);
}
- ///
- /// Create a new inventory item.
- ///
- /// Client creating this inventory item.
- ///
- ///
- /// UUID of folder in which this item should be placed.
- /// Item name.
- /// Item description.
- /// Item flags
- /// Generated by the client.
- /// Asset to which this item refers.
- /// Type of inventory item.
- /// Next owner pemrissions mask.
- /// Unix timestamp at which this item was created.
- public void CreateNewInventoryItem(
- IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
- string name, string description, uint flags, uint callbackID,
- UUID assetID, sbyte assetType, sbyte invType, uint nextOwnerMask, int creationDate)
- {
- CreateNewInventoryItem(
- remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, assetID, assetType, invType,
- (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0,
- creationDate, true);
- }
-
///
/// Create a new Inventory Item
///
@@ -1024,7 +998,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Next owner pemrissions mask.
/// Group permissions mask.
/// Unix timestamp at which this item was created.
- private void CreateNewInventoryItem(
+ public void CreateNewInventoryItem(
IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType,
uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate,
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 058b6f6a1e..e829b15edb 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2566,6 +2566,18 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
AddNewSceneObject(sceneObject, true);
sceneObject.SetGroup(groupID, null);
+
+ if (AgentPreferencesService != null) // This will override the brave new full perm world!
+ {
+ AgentPrefs prefs = AgentPreferencesService.GetAgentPreferences(ownerID);
+ // Only apply user selected prefs if the user set them
+ if (prefs.PermNextOwner != 0)
+ {
+ sceneObject.RootPart.GroupMask = (uint)prefs.PermGroup;
+ sceneObject.RootPart.EveryoneMask = (uint)prefs.PermEveryone;
+ sceneObject.RootPart.NextOwnerMask = (uint)prefs.PermNextOwner;
+ }
+ }
}
if (UserManagementModule != null)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index c17961b1d4..7d95c8d1e6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -482,7 +482,7 @@ namespace OpenSim.Region.Framework.Scenes
private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export);
private uint _groupMask = (uint)PermissionMask.None;
private uint _everyoneMask = (uint)PermissionMask.None;
- private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer);
+ private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Transfer);
private PrimFlags _flags = PrimFlags.None;
private DateTime m_expires;
private DateTime m_rezzed;
diff --git a/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs b/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs
index 713b75551c..b1b3c6fe2c 100644
--- a/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs
@@ -106,7 +106,8 @@ namespace OpenSim.Server.Handlers.AgentPreferences
return FailureResult();
AgentPrefs prefs = m_AgentPreferencesService.GetAgentPreferences(userID);
Dictionary result = new Dictionary();
- result = prefs.ToKeyValuePairs();
+ if (prefs != null)
+ result = prefs.ToKeyValuePairs();
string xmlString = ServerUtils.BuildXmlResponse(result);
diff --git a/OpenSim/Services/Interfaces/IAgentPreferencesService.cs b/OpenSim/Services/Interfaces/IAgentPreferencesService.cs
index 3b4fda20b0..ae2c5acd9d 100644
--- a/OpenSim/Services/Interfaces/IAgentPreferencesService.cs
+++ b/OpenSim/Services/Interfaces/IAgentPreferencesService.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces
// DefaultObjectPermMasks
public int PermEveryone = 0;
public int PermGroup = 0;
- public int PermNextOwner = 532480;
+ public int PermNextOwner = 0; // Illegal value by design
}
public interface IAgentPreferencesService
diff --git a/OpenSim/Services/UserAccountService/AgentPreferencesService.cs b/OpenSim/Services/UserAccountService/AgentPreferencesService.cs
index 1808ee5009..50131520dd 100644
--- a/OpenSim/Services/UserAccountService/AgentPreferencesService.cs
+++ b/OpenSim/Services/UserAccountService/AgentPreferencesService.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Services.UserAccountService
public AgentPrefs GetAgentPreferences(UUID principalID)
{
AgentPreferencesData d = m_Database.GetPrefs(principalID);
- AgentPrefs prefs = (d == null) ? new AgentPrefs(principalID) : new AgentPrefs(d.Data);
+ AgentPrefs prefs = (d == null) ? null : new AgentPrefs(d.Data);
return prefs;
}