First part of changing prim's permission flags to use the correct enum (libsl PermissionMask)

ThreadPoolClientBranch
MW 2008-01-16 17:31:07 +00:00
parent 771ed747e5
commit 795a339af5
3 changed files with 53 additions and 59 deletions

View File

@ -41,7 +41,6 @@ namespace OpenSim.Region.Environment.Modules
//this is a first attempt, to start breaking the mess thats called the assetcache up.
// basically this should be the texture sending (to clients) code moved out of assetcache
//and some small clean up
// but on first tests it didn't seem to work very well so is currently not in use.
public class TextureDownloadModule : IRegionModule
{
private Scene m_scene;
@ -173,5 +172,6 @@ namespace OpenSim.Region.Environment.Modules
sender.Sending = false;
m_scene.AddPendingDownloads(-1);
}
}
}

View File

@ -172,48 +172,72 @@ namespace OpenSim.Region.Environment
//return task.RootPart.ObjectFlags;task.RootPart.ObjectFlags |
uint OwnerMask = task.RootPart.ObjectFlags | task.RootPart.OwnerMask;
uint GroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask;
uint EveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask;
uint objectOwnerMask = task.RootPart.ObjectFlags;
if((task.RootPart.OwnerMask & (uint)PermissionMask.Copy) != 0)
{
objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectCopy;
}
if ((task.RootPart.OwnerMask & (uint) PermissionMask.Move) != 0)
{
objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectMove;
}
if ((task.RootPart.OwnerMask & (uint) PermissionMask.Modify) != 0)
{
objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectModify;
}
if ((task.RootPart.OwnerMask & (uint) PermissionMask.Transfer) != 0)
{
objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectTransfer;
}
uint objectGroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask;
uint objectEveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask;
if (m_bypassPermissions)
return OwnerMask;
return objectOwnerMask;
// Object owners should be able to edit their own content
if (user == objectOwner)
return OwnerMask;
{
objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectYouOwner;
return objectOwnerMask;
}
// Users should be able to edit what is over their land.
Land parcel = m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y);
if (parcel != null && parcel.landData.ownerID == user)
return OwnerMask;
return objectOwnerMask;
// Estate users should be able to edit anything in the sim
if (IsEstateManager(user))
return OwnerMask;
return objectOwnerMask;
// Admin objects should not be editable by the above
if (IsAdministrator(taskOwner))
return EveryoneMask;
return objectEveryoneMask;
// Admin should be able to edit anything in the sim (including admin objects)
if (IsAdministrator(user))
return OwnerMask;
return objectOwnerMask;
if (((EveryoneMask & PERM_MOVE) != 0) || ((EveryoneMask & PERM_COPY) != 0))
if (((objectEveryoneMask & PERM_MOVE) != 0) || ((objectEveryoneMask & PERM_COPY) != 0))
{
if ((EveryoneMask & PERM_MOVE) != 0)
OwnerMask &= ~PERM_MOVE;
if ((objectEveryoneMask & PERM_MOVE) != 0)
objectOwnerMask &= ~PERM_MOVE;
if ((EveryoneMask & PERM_COPY) != 0)
OwnerMask &= ~PERM_COPY;
if ((objectEveryoneMask & PERM_COPY) != 0)
objectOwnerMask &= ~PERM_COPY;
OwnerMask &= ~PERM_MODIFY;
OwnerMask &= ~PERM_TRANS;
objectOwnerMask &= ~PERM_MODIFY;
objectOwnerMask &= ~PERM_TRANS;
return OwnerMask;
return objectOwnerMask;
}
return EveryoneMask;
return objectEveryoneMask;
}
protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId)

View File

@ -44,12 +44,12 @@ namespace OpenSim.Region.Environment.Scenes
{
public partial class SceneObjectPart : IScriptHost
{
private const LLObject.ObjectFlags OBJFULL_MASK_GENERAL =
LLObject.ObjectFlags.ObjectCopy | LLObject.ObjectFlags.ObjectModify | LLObject.ObjectFlags.ObjectTransfer;
private const PermissionMask OBJFULL_MASK_GENERAL =
PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Move;
private const LLObject.ObjectFlags OBJFULL_MASK_OWNER =
LLObject.ObjectFlags.ObjectCopy | LLObject.ObjectFlags.ObjectModify | LLObject.ObjectFlags.ObjectOwnerModify |
LLObject.ObjectFlags.ObjectTransfer | LLObject.ObjectFlags.ObjectYouOwner;
private const PermissionMask OBJFULL_MASK_OWNER =
PermissionMask.Copy | PermissionMask.Modify |
PermissionMask.Transfer;
private const uint OBJNEXT_OWNER = 2147483647;
@ -76,10 +76,10 @@ namespace OpenSim.Region.Environment.Scenes
//
// Main grid has default permissions as follows
//
public uint OwnerMask = FULL_MASK_PERMISSIONS_OWNER;
public uint OwnerMask =(uint) PermissionMask.All;
public uint NextOwnerMask = OBJNEXT_OWNER;
public uint GroupMask = (uint) LLObject.ObjectFlags.None;
public uint EveryoneMask = (uint) LLObject.ObjectFlags.None;
public uint GroupMask = (uint) PermissionMask.None;
public uint EveryoneMask = (uint)PermissionMask.None;
public uint BaseMask = FULL_MASK_PERMISSIONS_OWNER;
protected byte[] m_particleSystem = new byte[0];
@ -697,21 +697,7 @@ namespace OpenSim.Region.Environment.Scenes
public void ApplySanePermissions()
{
// These are some flags that The OwnerMask should never have
OwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectGroupOwned;
OwnerMask &= ~(uint) LLObject.ObjectFlags.Physics;
OwnerMask &= ~(uint) LLObject.ObjectFlags.Phantom;
OwnerMask &= ~(uint) LLObject.ObjectFlags.Scripted;
OwnerMask &= ~(uint) LLObject.ObjectFlags.Touch;
OwnerMask &= ~(uint) LLObject.ObjectFlags.Temporary;
OwnerMask &= ~(uint) LLObject.ObjectFlags.TemporaryOnRez;
OwnerMask &= ~(uint) LLObject.ObjectFlags.ZlibCompressed;
OwnerMask &= ~(uint) LLObject.ObjectFlags.AllowInventoryDrop;
OwnerMask &= ~(uint) LLObject.ObjectFlags.AnimSource;
OwnerMask &= ~(uint) LLObject.ObjectFlags.Money;
OwnerMask &= ~(uint) LLObject.ObjectFlags.CastShadows;
OwnerMask &= ~(uint) LLObject.ObjectFlags.InventoryEmpty;
OwnerMask &= ~(uint) LLObject.ObjectFlags.CreateSelected;
// These are some flags that the next owner mask should never have
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner;
@ -754,23 +740,7 @@ namespace OpenSim.Region.Environment.Scenes
// These are some flags that EveryoneMask should never have
EveryoneMask &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.ObjectTransfer;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.ObjectOwnerModify;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.ObjectGroupOwned;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.Physics;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.Phantom;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.Scripted;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.Touch;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.Temporary;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.TemporaryOnRez;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.ZlibCompressed;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.AllowInventoryDrop;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.AnimSource;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.Money;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.CastShadows;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.InventoryEmpty;
EveryoneMask &= ~(uint) LLObject.ObjectFlags.CreateSelected;
//EveryoneMask = (uint)OBJFULL_MASK_EVERYONE;
// These are some flags that ObjectFlags (m_flags) should never have