add a usefull taint and update
parent
ce655056ca
commit
8d3d87e0b2
|
@ -252,65 +252,76 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
// new test code, to place in better place later
|
// new test code, to place in better place later
|
||||||
private object PermissionsLock = new object();
|
private object m_PermissionsLock = new object();
|
||||||
|
private bool m_EffectivePermsInvalid = true;
|
||||||
|
|
||||||
|
public void InvalidateEffectivePerms()
|
||||||
|
{
|
||||||
|
lock(m_PermissionsLock)
|
||||||
|
m_EffectivePermsInvalid = true;
|
||||||
|
}
|
||||||
|
|
||||||
private uint m_EffectiveEveryOnePerms;
|
private uint m_EffectiveEveryOnePerms;
|
||||||
public uint EffectiveEveryOnePerms
|
public uint EffectiveEveryOnePerms
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
|
lock(m_PermissionsLock)
|
||||||
// bc this is on heavy duty code paths
|
{
|
||||||
// but for now we need to test the concept
|
if(m_EffectivePermsInvalid)
|
||||||
// AggregateDeepPerms();
|
AggregatePerms();
|
||||||
return m_EffectiveEveryOnePerms;
|
return m_EffectiveEveryOnePerms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private uint m_EffectiveGroupPerms;
|
private uint m_EffectiveGroupPerms;
|
||||||
public uint EffectiveGroupPerms
|
public uint EffectiveGroupPerms
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
|
lock(m_PermissionsLock)
|
||||||
// bc this is on heavy duty code paths
|
{
|
||||||
// but for now we need to test the concept
|
if(m_EffectivePermsInvalid)
|
||||||
// AggregateDeepPerms();
|
AggregatePerms();
|
||||||
return m_EffectiveGroupPerms;
|
return m_EffectiveGroupPerms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private uint m_EffectiveGroupOrEveryOnePerms;
|
private uint m_EffectiveGroupOrEveryOnePerms;
|
||||||
public uint EffectiveGroupOrEveryOnePerms
|
public uint EffectiveGroupOrEveryOnePerms
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
|
lock(m_PermissionsLock)
|
||||||
// bc this is on heavy duty code paths
|
{
|
||||||
// but for now we need to test the concept
|
if(m_EffectivePermsInvalid)
|
||||||
// AggregateDeepPerms();
|
AggregatePerms();
|
||||||
return m_EffectiveGroupOrEveryOnePerms;
|
return m_EffectiveGroupOrEveryOnePerms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private uint m_EffectiveOwnerPerms;
|
private uint m_EffectiveOwnerPerms;
|
||||||
public uint EffectiveOwnerPerms
|
public uint EffectiveOwnerPerms
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
|
lock(m_PermissionsLock)
|
||||||
// bc this is on heavy duty code paths
|
{
|
||||||
// but for now we need to test the concept
|
if(m_EffectivePermsInvalid)
|
||||||
// AggregateDeepPerms();
|
AggregatePerms();
|
||||||
return m_EffectiveOwnerPerms;
|
return m_EffectiveOwnerPerms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// aggregates perms scanning parts and their contents
|
// aggregates perms scanning parts and their contents
|
||||||
// AggregatePerms does same using cached parts content perms
|
// AggregatePerms does same using cached parts content perms
|
||||||
public void AggregateDeepPerms()
|
public void AggregateDeepPerms()
|
||||||
{
|
{
|
||||||
lock(PermissionsLock)
|
lock(m_PermissionsLock)
|
||||||
{
|
{
|
||||||
// aux
|
// aux
|
||||||
const uint allmask = (uint)PermissionMask.AllEffective;
|
const uint allmask = (uint)PermissionMask.AllEffective;
|
||||||
|
@ -370,6 +381,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
m_EffectiveEveryOnePerms = everyone & owner;
|
m_EffectiveEveryOnePerms = everyone & owner;
|
||||||
m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner;
|
m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner;
|
||||||
|
m_EffectivePermsInvalid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,7 +389,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// ie is AggregateDeepPerms without the part.AggregateInnerPerms() call on parts loop
|
// ie is AggregateDeepPerms without the part.AggregateInnerPerms() call on parts loop
|
||||||
public void AggregatePerms()
|
public void AggregatePerms()
|
||||||
{
|
{
|
||||||
lock(PermissionsLock)
|
lock(m_PermissionsLock)
|
||||||
{
|
{
|
||||||
// aux
|
// aux
|
||||||
const uint allmask = (uint)PermissionMask.AllEffective;
|
const uint allmask = (uint)PermissionMask.AllEffective;
|
||||||
|
@ -394,6 +406,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
uint rootEveryonePerms = RootPart.EveryoneMask;
|
uint rootEveryonePerms = RootPart.EveryoneMask;
|
||||||
uint everyone = rootEveryonePerms;
|
uint everyone = rootEveryonePerms;
|
||||||
|
|
||||||
|
bool needUpdate = false;
|
||||||
|
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
for (int i = 0; i < parts.Length; i++)
|
for (int i = 0; i < parts.Length; i++)
|
||||||
{
|
{
|
||||||
|
@ -409,7 +423,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
owner |= (uint)PermissionMask.Transfer;
|
owner |= (uint)PermissionMask.Transfer;
|
||||||
|
|
||||||
owner &= basePerms;
|
owner &= basePerms;
|
||||||
|
if(owner != m_EffectiveOwnerPerms)
|
||||||
|
{
|
||||||
|
needUpdate = true;
|
||||||
m_EffectiveOwnerPerms = owner;
|
m_EffectiveOwnerPerms = owner;
|
||||||
|
}
|
||||||
|
|
||||||
uint ownertransfermask = owner & (uint)PermissionMask.Transfer;
|
uint ownertransfermask = owner & (uint)PermissionMask.Transfer;
|
||||||
|
|
||||||
// recover modify and move
|
// recover modify and move
|
||||||
|
@ -421,7 +440,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
group |= ownertransfermask;
|
group |= ownertransfermask;
|
||||||
|
|
||||||
uint groupOrEveryone = group;
|
uint groupOrEveryone = group;
|
||||||
m_EffectiveGroupPerms = group & owner;
|
uint tmpPerms = group & owner;
|
||||||
|
if(tmpPerms != m_EffectiveGroupPerms)
|
||||||
|
{
|
||||||
|
needUpdate = true;
|
||||||
|
m_EffectiveGroupPerms = tmpPerms;
|
||||||
|
}
|
||||||
|
|
||||||
// recover move
|
// recover move
|
||||||
rootEveryonePerms &= (uint)PermissionMask.Move;
|
rootEveryonePerms &= (uint)PermissionMask.Move;
|
||||||
|
@ -434,8 +458,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
groupOrEveryone |= everyone;
|
groupOrEveryone |= everyone;
|
||||||
|
|
||||||
m_EffectiveEveryOnePerms = everyone & owner;
|
tmpPerms = everyone & owner;
|
||||||
m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner;
|
if(tmpPerms != m_EffectiveEveryOnePerms)
|
||||||
|
{
|
||||||
|
needUpdate = true;
|
||||||
|
m_EffectiveEveryOnePerms = tmpPerms;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpPerms = groupOrEveryone & owner;
|
||||||
|
if(tmpPerms != m_EffectiveGroupOrEveryOnePerms)
|
||||||
|
{
|
||||||
|
needUpdate = true;
|
||||||
|
m_EffectiveGroupOrEveryOnePerms = tmpPerms;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_EffectivePermsInvalid = false;
|
||||||
|
|
||||||
|
if(needUpdate)
|
||||||
|
RootPart.ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2579,6 +2579,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
AggregatedInnerOwnerPerms = owner & mask;
|
AggregatedInnerOwnerPerms = owner & mask;
|
||||||
AggregatedInnerGroupPerms = group & mask;
|
AggregatedInnerGroupPerms = group & mask;
|
||||||
AggregatedInnerEveryonePerms = everyone & mask;
|
AggregatedInnerEveryonePerms = everyone & mask;
|
||||||
|
if(ParentGroup != null)
|
||||||
|
ParentGroup.InvalidateEffectivePerms();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue