mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Committing patch from Melanie. 0001290: [PATCH] implement permissions propagation and script module hooks. Thanks Melanie!
* Implements quite a few inventory related perms. * (from Teravus) Fixes Take Copy
This commit is contained in:
@@ -61,7 +61,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID)
|
||||
{
|
||||
uint perms=(uint)2147483647;
|
||||
SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
|
||||
|
||||
uint perms=part.GetEffectiveObjectFlags() |
|
||||
(uint)LLObject.ObjectFlags.ObjectModify |
|
||||
(uint)LLObject.ObjectFlags.ObjectCopy |
|
||||
(uint)LLObject.ObjectFlags.ObjectMove |
|
||||
(uint)LLObject.ObjectFlags.ObjectTransfer |
|
||||
(uint)LLObject.ObjectFlags.ObjectYouOwner |
|
||||
(uint)LLObject.ObjectFlags.ObjectYouOfficer;
|
||||
|
||||
foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
|
||||
{
|
||||
perms &= check(userID, objectID);
|
||||
@@ -117,6 +126,32 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
return true;
|
||||
}
|
||||
|
||||
public delegate bool PropagatePermissions();
|
||||
private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>();
|
||||
|
||||
public void addPropagatePermissions(PropagatePermissions delegateFunc)
|
||||
{
|
||||
if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc))
|
||||
PropagatePermissionsCheckFunctions.Add(delegateFunc);
|
||||
}
|
||||
public void removePropagatePermissions(PropagatePermissions delegateFunc)
|
||||
{
|
||||
if (PropagatePermissionsCheckFunctions.Contains(delegateFunc))
|
||||
PropagatePermissionsCheckFunctions.Remove(delegateFunc);
|
||||
}
|
||||
|
||||
public bool ExternalChecksPropagatePermissions()
|
||||
{
|
||||
foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions)
|
||||
{
|
||||
if (check() == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#region REZ OBJECT
|
||||
public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene);
|
||||
private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>();
|
||||
|
||||
Reference in New Issue
Block a user