aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Permissions
diff options
context:
space:
mode:
authorUbitUmarov2017-01-15 16:15:40 +0000
committerUbitUmarov2017-01-15 16:15:40 +0000
commitb9e2606c2ff820369659940e4aafbcb55390794a (patch)
tree3b2b92a6b7e20a5959ac93b4b5004e1c986b8fdd /OpenSim/Region/CoreModules/World/Permissions
parentuse of PermissionMask Bit3 for slam was a recent mistake, so make it only bit... (diff)
downloadopensim-SC-b9e2606c2ff820369659940e4aafbcb55390794a.zip
opensim-SC-b9e2606c2ff820369659940e4aafbcb55390794a.tar.gz
opensim-SC-b9e2606c2ff820369659940e4aafbcb55390794a.tar.bz2
opensim-SC-b9e2606c2ff820369659940e4aafbcb55390794a.tar.xz
add code for fixing effective permitions. This is a test, and currently too slow for prodution. just finding our way home
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Permissions')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs39
1 files changed, 26 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index b60cd93..dcf0c00 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -631,7 +631,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
631 631
632 #region Object Permissions 632 #region Object Permissions
633#pragma warning disable 0612 633#pragma warning disable 0612
634 const uint DEFAULT_FLAGS = (uint)~( 634 const uint DEFAULT_FLAGS = (uint)(
635 PrimFlags.ObjectCopy | // Tells client you can copy the object 635 PrimFlags.ObjectCopy | // Tells client you can copy the object
636 PrimFlags.ObjectModify | // tells client you can modify the object 636 PrimFlags.ObjectModify | // tells client you can modify the object
637 PrimFlags.ObjectMove | // tells client that you can move the object (only, no mod) 637 PrimFlags.ObjectMove | // tells client that you can move the object (only, no mod)
@@ -665,6 +665,16 @@ namespace OpenSim.Region.CoreModules.World.Permissions
665 PrimFlags.ObjectMove 665 PrimFlags.ObjectMove
666 ); 666 );
667 667
668 const uint GOD_FLAGS = (uint)(
669 PrimFlags.ObjectCopy | // Tells client you can copy the object
670 PrimFlags.ObjectModify | // tells client you can modify the object
671 PrimFlags.ObjectMove | // tells client that you can move the object (only, no mod)
672 PrimFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it
673 PrimFlags.ObjectYouOwner | // Tells client that you're the owner of the object
674 PrimFlags.ObjectAnyOwner | // Tells client that someone owns the object
675 PrimFlags.ObjectOwnerModify // Tells client that you're the owner of the object
676 );
677
668 public uint GenerateClientFlags(ScenePresence sp, uint curEffectivePerms, UUID objID) 678 public uint GenerateClientFlags(ScenePresence sp, uint curEffectivePerms, UUID objID)
669 { 679 {
670 if(sp == null || curEffectivePerms == 0) 680 if(sp == null || curEffectivePerms == 0)
@@ -684,22 +694,25 @@ namespace OpenSim.Region.CoreModules.World.Permissions
684 // gods have owner rights with Modify and Move always on 694 // gods have owner rights with Modify and Move always on
685 if(sp.IsGod) 695 if(sp.IsGod)
686 { 696 {
687 returnMask = ApplyObjectModifyMasks(task.OwnerMask, objflags, true); 697// returnMask = ApplyObjectModifyMasks(task.OwnerMask, objflags, true);
688 returnMask |= EXTRAGODMASK; 698// returnMask |= EXTRAGODMASK;
689 return returnMask; 699// return returnMask;
700 return objflags | GOD_FLAGS;
690 } 701 }
691 702
703 SceneObjectGroup grp = task.ParentGroup;
704 bool unlocked = (grp.RootPart.OwnerMask & (uint)PermissionMask.Move) != 0;
705
692 //bypass option == owner rights 706 //bypass option == owner rights
693 if (m_bypassPermissions) 707 if (m_bypassPermissions)
694 { 708 {
695 returnMask = ApplyObjectModifyMasks(task.OwnerMask, objflags, true); 709 returnMask = ApplyObjectModifyMasks(task.OwnerMask, objflags, true); //??
696 returnMask |= EXTRAOWNERMASK; 710 returnMask |= EXTRAOWNERMASK;
697 if((returnMask & (uint)PrimFlags.ObjectModify) != 0) 711 if((returnMask & (uint)PrimFlags.ObjectModify) != 0)
698 returnMask |= (uint)PrimFlags.ObjectOwnerModify; 712 returnMask |= (uint)PrimFlags.ObjectOwnerModify;
699 return returnMask; 713 return returnMask;
700 } 714 }
701 715
702 bool unlocked = (task.ParentGroup.RootPart.OwnerMask & (uint)PermissionMask.Move) != 0;
703 716
704 UUID taskOwnerID = task.OwnerID; 717 UUID taskOwnerID = task.OwnerID;
705 UUID spID = sp.UUID; 718 UUID spID = sp.UUID;
@@ -707,7 +720,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
707 // owner 720 // owner
708 if (spID == taskOwnerID) 721 if (spID == taskOwnerID)
709 { 722 {
710 returnMask = ApplyObjectModifyMasks(task.OwnerMask, objflags, unlocked); 723 returnMask = ApplyObjectModifyMasks(grp.EffectiveOwnerPerms, objflags, unlocked);
711 returnMask |= EXTRAOWNERMASK; 724 returnMask |= EXTRAOWNERMASK;
712 if((returnMask & (uint)PrimFlags.ObjectModify) != 0) 725 if((returnMask & (uint)PrimFlags.ObjectModify) != 0)
713 returnMask |= (uint)PrimFlags.ObjectOwnerModify; 726 returnMask |= (uint)PrimFlags.ObjectOwnerModify;
@@ -717,7 +730,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
717 // if not god or owner, do attachments as everyone 730 // if not god or owner, do attachments as everyone
718 if(task.ParentGroup.IsAttachment) 731 if(task.ParentGroup.IsAttachment)
719 { 732 {
720 returnMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags, unlocked); 733 returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked);
721 if (taskOwnerID != UUID.Zero) 734 if (taskOwnerID != UUID.Zero)
722 returnMask |= (uint)PrimFlags.ObjectAnyOwner; 735 returnMask |= (uint)PrimFlags.ObjectAnyOwner;
723 return returnMask; 736 return returnMask;
@@ -729,7 +742,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
729 // if friends with rights then owner 742 // if friends with rights then owner
730 if (!groupdOwned && IsFriendWithPerms(spID, taskOwnerID)) 743 if (!groupdOwned && IsFriendWithPerms(spID, taskOwnerID))
731 { 744 {
732 returnMask = ApplyObjectModifyMasks(task.OwnerMask, objflags, unlocked); 745 returnMask = ApplyObjectModifyMasks(grp.EffectiveOwnerPerms, objflags, unlocked);
733 returnMask |= EXTRAOWNERMASK; 746 returnMask |= EXTRAOWNERMASK;
734 if((returnMask & (uint)PrimFlags.ObjectModify) != 0) 747 if((returnMask & (uint)PrimFlags.ObjectModify) != 0)
735 returnMask |= (uint)PrimFlags.ObjectOwnerModify; 748 returnMask |= (uint)PrimFlags.ObjectOwnerModify;
@@ -745,7 +758,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
745 // object is owned by group, check role powers 758 // object is owned by group, check role powers
746 if((client.GetGroupPowers(taskGroupID) & (ulong)GroupPowers.ObjectManipulate) != 0) 759 if((client.GetGroupPowers(taskGroupID) & (ulong)GroupPowers.ObjectManipulate) != 0)
747 { 760 {
748 returnMask = ApplyObjectModifyMasks(task.OwnerMask, objflags, unlocked); 761 returnMask = ApplyObjectModifyMasks(grp.EffectiveOwnerPerms, objflags, unlocked);
749 returnMask |= 762 returnMask |=
750 (uint)PrimFlags.ObjectGroupOwned | 763 (uint)PrimFlags.ObjectGroupOwned |
751 (uint)PrimFlags.ObjectAnyOwner; 764 (uint)PrimFlags.ObjectAnyOwner;
@@ -756,7 +769,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
756 else 769 else
757 { 770 {
758 // group sharing or everyone 771 // group sharing or everyone
759 returnMask = ApplyObjectModifyMasks(task.GroupMask | task.EveryoneMask, objflags, unlocked); 772 returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
760 returnMask |= 773 returnMask |=
761 (uint)PrimFlags.ObjectGroupOwned | 774 (uint)PrimFlags.ObjectGroupOwned |
762 (uint)PrimFlags.ObjectAnyOwner; 775 (uint)PrimFlags.ObjectAnyOwner;
@@ -766,7 +779,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
766 else 779 else
767 { 780 {
768 // group sharing or everyone 781 // group sharing or everyone
769 returnMask = ApplyObjectModifyMasks(task.GroupMask | task.EveryoneMask, objflags, unlocked); 782 returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
770 if (taskOwnerID != UUID.Zero) 783 if (taskOwnerID != UUID.Zero)
771 returnMask |= (uint)PrimFlags.ObjectAnyOwner; 784 returnMask |= (uint)PrimFlags.ObjectAnyOwner;
772 return returnMask; 785 return returnMask;
@@ -774,7 +787,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
774 } 787 }
775 788
776 // fallback is everyone rights 789 // fallback is everyone rights
777 returnMask = ApplyObjectModifyMasks(task.EveryoneMask, objflags, unlocked); 790 returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked);
778 if (taskOwnerID != UUID.Zero) 791 if (taskOwnerID != UUID.Zero)
779 returnMask |= (uint)PrimFlags.ObjectAnyOwner; 792 returnMask |= (uint)PrimFlags.ObjectAnyOwner;
780 return returnMask; 793 return returnMask;