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
parent
d42de53dda
commit
59ed89769a
|
@ -242,7 +242,7 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
public delegate void CreateNewInventoryItem(
|
public delegate void CreateNewInventoryItem(
|
||||||
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
|
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(
|
public delegate void LinkInventoryItem(
|
||||||
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
|
IClientAPI remoteClient, UUID transActionID, UUID folderID, uint callbackID, string description, string name,
|
||||||
|
|
|
@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
/// <param name="nextOwnerMask"></param>
|
/// <param name="nextOwnerMask"></param>
|
||||||
public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID,
|
public void CreateNewInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID folderID,
|
||||||
uint callbackID, string description, string name, sbyte invType,
|
uint callbackID, string description, string name, sbyte invType,
|
||||||
sbyte assetType,
|
sbyte assetType, byte wearableType,
|
||||||
byte wearableType, uint nextOwnerMask, int creationDate)
|
uint nextOwnerMask, int creationDate)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[INVENTORY ACCESS MODULE]: Received request to create inventory item {0} in folder {1}, transactionID {2}", name,
|
m_log.DebugFormat("[INVENTORY ACCESS MODULE]: Received request to create inventory item {0} in folder {1}, transactionID {2}", name,
|
||||||
folderID, transactionID);
|
folderID, transactionID);
|
||||||
|
@ -220,7 +220,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
m_Scene.AssetService.Store(asset);
|
m_Scene.AssetService.Store(asset);
|
||||||
m_Scene.CreateNewInventoryItem(
|
m_Scene.CreateNewInventoryItem(
|
||||||
remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -979,32 +979,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + remoteClient.AgentId);
|
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>
|
/// <summary>
|
||||||
/// Create a new Inventory Item
|
/// Create a new Inventory Item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1024,7 +998,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="nextOwnerMask">Next owner pemrissions mask.</param>
|
/// <param name="nextOwnerMask">Next owner pemrissions mask.</param>
|
||||||
/// <param name="groupMask">Group permissions mask.</param>
|
/// <param name="groupMask">Group permissions mask.</param>
|
||||||
/// <param name="creationDate">Unix timestamp at which this item was created.</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,
|
IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
|
||||||
string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType,
|
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,
|
uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate,
|
||||||
|
|
|
@ -2566,6 +2566,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
|
sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
|
||||||
AddNewSceneObject(sceneObject, true);
|
AddNewSceneObject(sceneObject, true);
|
||||||
sceneObject.SetGroup(groupID, null);
|
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)
|
if (UserManagementModule != null)
|
||||||
|
|
|
@ -482,7 +482,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export);
|
private uint _ownerMask = (uint)(PermissionMask.All | PermissionMask.Export);
|
||||||
private uint _groupMask = (uint)PermissionMask.None;
|
private uint _groupMask = (uint)PermissionMask.None;
|
||||||
private uint _everyoneMask = (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 PrimFlags _flags = PrimFlags.None;
|
||||||
private DateTime m_expires;
|
private DateTime m_expires;
|
||||||
private DateTime m_rezzed;
|
private DateTime m_rezzed;
|
||||||
|
|
|
@ -106,7 +106,8 @@ namespace OpenSim.Server.Handlers.AgentPreferences
|
||||||
return FailureResult();
|
return FailureResult();
|
||||||
AgentPrefs prefs = m_AgentPreferencesService.GetAgentPreferences(userID);
|
AgentPrefs prefs = m_AgentPreferencesService.GetAgentPreferences(userID);
|
||||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||||
result = prefs.ToKeyValuePairs();
|
if (prefs != null)
|
||||||
|
result = prefs.ToKeyValuePairs();
|
||||||
|
|
||||||
string xmlString = ServerUtils.BuildXmlResponse(result);
|
string xmlString = ServerUtils.BuildXmlResponse(result);
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
// DefaultObjectPermMasks
|
// DefaultObjectPermMasks
|
||||||
public int PermEveryone = 0;
|
public int PermEveryone = 0;
|
||||||
public int PermGroup = 0;
|
public int PermGroup = 0;
|
||||||
public int PermNextOwner = 532480;
|
public int PermNextOwner = 0; // Illegal value by design
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IAgentPreferencesService
|
public interface IAgentPreferencesService
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace OpenSim.Services.UserAccountService
|
||||||
public AgentPrefs GetAgentPreferences(UUID principalID)
|
public AgentPrefs GetAgentPreferences(UUID principalID)
|
||||||
{
|
{
|
||||||
AgentPreferencesData d = m_Database.GetPrefs(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;
|
return prefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue