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.
LSLKeyTest
Melanie Thielker 2016-04-29 22:36:56 +02:00
parent d42de53dda
commit 59ed89769a
8 changed files with 25 additions and 35 deletions

View File

@ -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,

View File

@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
/// <param name="nextOwnerMask"></param>
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
{

View File

@ -979,32 +979,6 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + remoteClient.AgentId);
}
/// <summary>
/// Create a new inventory item.
/// </summary>
/// <param name="remoteClient">Client creating this inventory item.</param>
/// <param name="creatorID"></param>
/// <param name="creatorData"></param>
/// <param name="folderID">UUID of folder in which this item should be placed.</param>
/// <param name="name">Item name.</para>
/// <param name="description">Item description.</param>
/// <param name="flags">Item flags</param>
/// <param name="callbackID">Generated by the client.</para>
/// <param name="asset">Asset to which this item refers.</param>
/// <param name="invType">Type of inventory item.</param>
/// <param name="nextOwnerMask">Next owner pemrissions mask.</param>
/// <param name="creationDate">Unix timestamp at which this item was created.</param>
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);
}
/// <summary>
/// Create a new Inventory Item
/// </summary>
@ -1024,7 +998,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="nextOwnerMask">Next owner pemrissions mask.</param>
/// <param name="groupMask">Group permissions mask.</param>
/// <param name="creationDate">Unix timestamp at which this item was created.</param>
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,

View File

@ -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)

View File

@ -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;

View File

@ -106,7 +106,8 @@ namespace OpenSim.Server.Handlers.AgentPreferences
return FailureResult();
AgentPrefs prefs = m_AgentPreferencesService.GetAgentPreferences(userID);
Dictionary<string, object> result = new Dictionary<string, object>();
result = prefs.ToKeyValuePairs();
if (prefs != null)
result = prefs.ToKeyValuePairs();
string xmlString = ServerUtils.BuildXmlResponse(result);

View File

@ -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

View File

@ -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;
}