diff options
author | Melanie Thielker | 2016-04-29 22:36:56 +0200 |
---|---|---|
committer | Melanie Thielker | 2016-04-29 22:36:56 +0200 |
commit | 59ed89769aa292196f99affe0a99a758e63a538a (patch) | |
tree | 2c09cf5c14e2dc51b0e95cdd95ffd29d01abcbe0 | |
parent | Allow default permissions from the viewer to be applied to uploaded objects. (diff) | |
download | opensim-SC_OLD-59ed89769aa292196f99affe0a99a758e63a538a.zip opensim-SC_OLD-59ed89769aa292196f99affe0a99a758e63a538a.tar.gz opensim-SC_OLD-59ed89769aa292196f99affe0a99a758e63a538a.tar.bz2 opensim-SC_OLD-59ed89769aa292196f99affe0a99a758e63a538a.tar.xz |
Apply user specified default perms across the board, to items uploaded as well as items created and to rezzed prims in world.
This effectively removes the concept of "default permissions" from OpenSim
because all known modern viewers set the permissions flags on login.
Ancient abandoned viewers will now default to the SL defaults.
8 files changed, 25 insertions, 35 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 696b0ef..c949c04 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -242,7 +242,7 @@ namespace OpenSim.Framework | |||
242 | 242 | ||
243 | public delegate void CreateNewInventoryItem( | 243 | public delegate void CreateNewInventoryItem( |
244 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, | 244 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, |
245 | sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask, int creationDate); | 245 | sbyte invType, sbyte type, byte wearableType, uint everyoneMask, int creationDate); |
246 | 246 | ||
247 | public delegate void LinkInventoryItem( | 247 | public delegate void LinkInventoryItem( |
248 | IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name, | 248 | 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 49a708b..d4a929c 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 | |||
175 | /// <param name="nextOwnerMask"></param> | 175 | /// <param name="nextOwnerMask"></param> |
176 | public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, | 176 | public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID, |
177 | uint callbackID, string description, string name, sbyte invType, | 177 | uint callbackID, string description, string name, sbyte invType, |
178 | sbyte assetType, | 178 | sbyte assetType, byte wearableType, |
179 | byte wearableType, uint nextOwnerMask, int creationDate) | 179 | uint nextOwnerMask, int creationDate) |
180 | { | 180 | { |
181 | m_log.DebugFormat("[INVENTORY ACCESS MODULE]: Received request to create inventory item {0} in folder {1}, transactionID {2}", name, | 181 | m_log.DebugFormat("[INVENTORY ACCESS MODULE]: Received request to create inventory item {0} in folder {1}, transactionID {2}", name, |
182 | folderID, transactionID); | 182 | folderID, transactionID); |
@@ -220,7 +220,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
220 | m_Scene.AssetService.Store(asset); | 220 | m_Scene.AssetService.Store(asset); |
221 | m_Scene.CreateNewInventoryItem( | 221 | m_Scene.CreateNewInventoryItem( |
222 | remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, | 222 | remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, |
223 | name, description, 0, callbackID, asset.FullID, asset.Type, invType, nextOwnerMask, creationDate); | 223 | name, description, 0, callbackID, asset.FullID, asset.Type, invType, |
224 | (uint)PermissionMask.All | (uint)PermissionMask.Export, // Base | ||
225 | (uint)PermissionMask.All | (uint)PermissionMask.Export, // Current | ||
226 | 0, nextOwnerMask, 0, creationDate, false); // Data from viewer | ||
224 | } | 227 | } |
225 | else | 228 | else |
226 | { | 229 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index a28737e..b77b860 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -980,32 +980,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
980 | } | 980 | } |
981 | 981 | ||
982 | /// <summary> | 982 | /// <summary> |
983 | /// Create a new inventory item. | ||
984 | /// </summary> | ||
985 | /// <param name="remoteClient">Client creating this inventory item.</param> | ||
986 | /// <param name="creatorID"></param> | ||
987 | /// <param name="creatorData"></param> | ||
988 | /// <param name="folderID">UUID of folder in which this item should be placed.</param> | ||
989 | /// <param name="name">Item name.</para> | ||
990 | /// <param name="description">Item description.</param> | ||
991 | /// <param name="flags">Item flags</param> | ||
992 | /// <param name="callbackID">Generated by the client.</para> | ||
993 | /// <param name="asset">Asset to which this item refers.</param> | ||
994 | /// <param name="invType">Type of inventory item.</param> | ||
995 | /// <param name="nextOwnerMask">Next owner pemrissions mask.</param> | ||
996 | /// <param name="creationDate">Unix timestamp at which this item was created.</param> | ||
997 | public void CreateNewInventoryItem( | ||
998 | IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, | ||
999 | string name, string description, uint flags, uint callbackID, | ||
1000 | UUID assetID, sbyte assetType, sbyte invType, uint nextOwnerMask, int creationDate) | ||
1001 | { | ||
1002 | CreateNewInventoryItem( | ||
1003 | remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, assetID, assetType, invType, | ||
1004 | (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, | ||
1005 | creationDate, true); | ||
1006 | } | ||
1007 | |||
1008 | /// <summary> | ||
1009 | /// Create a new Inventory Item | 983 | /// Create a new Inventory Item |
1010 | /// </summary> | 984 | /// </summary> |
1011 | /// <param name="remoteClient">Client creating this inventory item.</param> | 985 | /// <param name="remoteClient">Client creating this inventory item.</param> |
@@ -1024,7 +998,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1024 | /// <param name="nextOwnerMask">Next owner pemrissions mask.</param> | 998 | /// <param name="nextOwnerMask">Next owner pemrissions mask.</param> |
1025 | /// <param name="groupMask">Group permissions mask.</param> | 999 | /// <param name="groupMask">Group permissions mask.</param> |
1026 | /// <param name="creationDate">Unix timestamp at which this item was created.</param> | 1000 | /// <param name="creationDate">Unix timestamp at which this item was created.</param> |
1027 | private void CreateNewInventoryItem( | 1001 | public void CreateNewInventoryItem( |
1028 | IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, | 1002 | IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, |
1029 | string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType, | 1003 | string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType, |
1030 | uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate, | 1004 | 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 058b6f6..e829b15 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2566,6 +2566,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2566 | sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); | 2566 | sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); |
2567 | AddNewSceneObject(sceneObject, true); | 2567 | AddNewSceneObject(sceneObject, true); |
2568 | sceneObject.SetGroup(groupID, null); | 2568 | sceneObject.SetGroup(groupID, null); |
2569 | |||
2570 | if (AgentPreferencesService != null) // This will override the brave new full perm world! | ||
2571 | { | ||
2572 | AgentPrefs prefs = AgentPreferencesService.GetAgentPreferences(ownerID); | ||
2573 | // Only apply user selected prefs if the user set them | ||
2574 | if (prefs.PermNextOwner != 0) | ||
2575 | { | ||
2576 | sceneObject.RootPart.GroupMask = (uint)prefs.PermGroup; | ||
2577 | sceneObject.RootPart.EveryoneMask = (uint)prefs.PermEveryone; | ||
2578 | sceneObject.RootPart.NextOwnerMask = (uint)prefs.PermNextOwner; | ||
2579 | } | ||
2580 | } | ||
2569 | } | 2581 | } |
2570 | 2582 | ||
2571 | if (UserManagementModule != null) | 2583 | if (UserManagementModule != null) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c17961b..7d95c8d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -482,7 +482,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
482 | private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export); | 482 | private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export); |
483 | private uint _groupMask = (uint)PermissionMask.None; | 483 | private uint _groupMask = (uint)PermissionMask.None; |
484 | private uint _everyoneMask = (uint)PermissionMask.None; | 484 | private uint _everyoneMask = (uint)PermissionMask.None; |
485 | private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); | 485 | private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Transfer); |
486 | private PrimFlags _flags = PrimFlags.None; | 486 | private PrimFlags _flags = PrimFlags.None; |
487 | private DateTime m_expires; | 487 | private DateTime m_expires; |
488 | private DateTime m_rezzed; | 488 | private DateTime m_rezzed; |
diff --git a/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs b/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs index 713b755..b1b3c6f 100644 --- a/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs +++ b/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServerPostHandler.cs | |||
@@ -106,7 +106,8 @@ namespace OpenSim.Server.Handlers.AgentPreferences | |||
106 | return FailureResult(); | 106 | return FailureResult(); |
107 | AgentPrefs prefs = m_AgentPreferencesService.GetAgentPreferences(userID); | 107 | AgentPrefs prefs = m_AgentPreferencesService.GetAgentPreferences(userID); |
108 | Dictionary<string, object> result = new Dictionary<string, object>(); | 108 | Dictionary<string, object> result = new Dictionary<string, object>(); |
109 | result = prefs.ToKeyValuePairs(); | 109 | if (prefs != null) |
110 | result = prefs.ToKeyValuePairs(); | ||
110 | 111 | ||
111 | string xmlString = ServerUtils.BuildXmlResponse(result); | 112 | string xmlString = ServerUtils.BuildXmlResponse(result); |
112 | 113 | ||
diff --git a/OpenSim/Services/Interfaces/IAgentPreferencesService.cs b/OpenSim/Services/Interfaces/IAgentPreferencesService.cs index 3b4fda2..ae2c5ac 100644 --- a/OpenSim/Services/Interfaces/IAgentPreferencesService.cs +++ b/OpenSim/Services/Interfaces/IAgentPreferencesService.cs | |||
@@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces | |||
101 | // DefaultObjectPermMasks | 101 | // DefaultObjectPermMasks |
102 | public int PermEveryone = 0; | 102 | public int PermEveryone = 0; |
103 | public int PermGroup = 0; | 103 | public int PermGroup = 0; |
104 | public int PermNextOwner = 532480; | 104 | public int PermNextOwner = 0; // Illegal value by design |
105 | } | 105 | } |
106 | 106 | ||
107 | public interface IAgentPreferencesService | 107 | public interface IAgentPreferencesService |
diff --git a/OpenSim/Services/UserAccountService/AgentPreferencesService.cs b/OpenSim/Services/UserAccountService/AgentPreferencesService.cs index 1808ee5..5013152 100644 --- a/OpenSim/Services/UserAccountService/AgentPreferencesService.cs +++ b/OpenSim/Services/UserAccountService/AgentPreferencesService.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Services.UserAccountService | |||
49 | public AgentPrefs GetAgentPreferences(UUID principalID) | 49 | public AgentPrefs GetAgentPreferences(UUID principalID) |
50 | { | 50 | { |
51 | AgentPreferencesData d = m_Database.GetPrefs(principalID); | 51 | AgentPreferencesData d = m_Database.GetPrefs(principalID); |
52 | AgentPrefs prefs = (d == null) ? new AgentPrefs(principalID) : new AgentPrefs(d.Data); | 52 | AgentPrefs prefs = (d == null) ? null : new AgentPrefs(d.Data); |
53 | return prefs; | 53 | return prefs; |
54 | } | 54 | } |
55 | 55 | ||