diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 1bb5181..495da8b 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -623,7 +623,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
623 | PrimFlags.ObjectOwnerModify | 623 | PrimFlags.ObjectOwnerModify |
624 | ); | 624 | ); |
625 | 625 | ||
626 | public uint GenerateClientFlags(UUID user, UUID objID) | 626 | public uint GenerateClientFlags(ScenePresence sp, UUID objID) |
627 | { | 627 | { |
628 | // ObjectFlags and Permission flags are two different enumerations | 628 | // ObjectFlags and Permission flags are two different enumerations |
629 | // ObjectFlags, tells the client what it will allow the user to do. | 629 | // ObjectFlags, tells the client what it will allow the user to do. |
@@ -641,8 +641,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
641 | 641 | ||
642 | objflags &= NOT_DEFAULT_FLAGS; | 642 | objflags &= NOT_DEFAULT_FLAGS; |
643 | 643 | ||
644 | // get a relevant class for current user on task | 644 | // get a relevant class for current presence on task |
645 | PermissionClass permissionClass = GetPermissionClass(user, task); | 645 | PermissionClass permissionClass = GetPermissionClass(sp, task); |
646 | 646 | ||
647 | // handle acording | 647 | // handle acording |
648 | uint returnMask = 0; | 648 | uint returnMask = 0; |
@@ -668,10 +668,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
668 | returnMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags); | 668 | returnMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags); |
669 | if (task.OwnerID != UUID.Zero) | 669 | if (task.OwnerID != UUID.Zero) |
670 | returnMask |= (uint)PrimFlags.ObjectAnyOwner; | 670 | returnMask |= (uint)PrimFlags.ObjectAnyOwner; |
671 | |||
672 | // allow estatemanagers to move prims to help solve disputes | ||
673 | if(!task.ParentGroup.IsAttachment && IsEstateManager(user)) | ||
674 | returnMask |= (uint)PrimFlags.ObjectMove; | ||
675 | break; | 671 | break; |
676 | } | 672 | } |
677 | return returnMask; | 673 | return returnMask; |
@@ -705,6 +701,39 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
705 | return objectFlagsMask; | 701 | return objectFlagsMask; |
706 | } | 702 | } |
707 | 703 | ||
704 | private PermissionClass GetPermissionClass(ScenePresence sp, SceneObjectPart obj) | ||
705 | { | ||
706 | if (obj == null || sp == null) | ||
707 | return PermissionClass.Everyone; | ||
708 | |||
709 | if (m_bypassPermissions) | ||
710 | return PermissionClass.Owner; | ||
711 | |||
712 | |||
713 | if (sp.IsGod) | ||
714 | return PermissionClass.Owner; | ||
715 | |||
716 | UUID user = sp.UUID; | ||
717 | |||
718 | // Object owners should be able to edit their own content | ||
719 | UUID objectOwner = obj.OwnerID; | ||
720 | if (user == objectOwner) | ||
721 | return PermissionClass.Owner; | ||
722 | |||
723 | if(!obj.ParentGroup.IsAttachment) | ||
724 | { | ||
725 | if (IsFriendWithPerms(user, objectOwner) ) | ||
726 | return PermissionClass.Owner; | ||
727 | |||
728 | // Group permissions | ||
729 | if (obj.GroupID != UUID.Zero && IsGroupMember(obj.GroupID, user, 0)) | ||
730 | return PermissionClass.Group; | ||
731 | } | ||
732 | |||
733 | return PermissionClass.Everyone; | ||
734 | } | ||
735 | |||
736 | // OARs need this method that handles offline users | ||
708 | public PermissionClass GetPermissionClass(UUID user, SceneObjectPart obj) | 737 | public PermissionClass GetPermissionClass(UUID user, SceneObjectPart obj) |
709 | { | 738 | { |
710 | if (obj == null) | 739 | if (obj == null) |