aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2017-01-22 05:07:43 +0000
committerUbitUmarov2017-01-22 05:07:43 +0000
commit8d99c86f96319e143e8e3b5a642c420fd0867c57 (patch)
treec3682916ec63f737519af08e0dde13de7e98a050 /OpenSim/Region/CoreModules
parentwork around group sharing and owned permitions issues, fix a non copy objects... (diff)
downloadopensim-SC-8d99c86f96319e143e8e3b5a642c420fd0867c57.zip
opensim-SC-8d99c86f96319e143e8e3b5a642c420fd0867c57.tar.gz
opensim-SC-8d99c86f96319e143e8e3b5a642c420fd0867c57.tar.bz2
opensim-SC-8d99c86f96319e143e8e3b5a642c420fd0867c57.tar.xz
share before groupr roles was a testing elsewhere induced mistake, clean it up
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs82
1 files changed, 36 insertions, 46 deletions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index e16022d..b0fdd11 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -739,10 +739,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
739 } 739 }
740 740
741 UUID taskGroupID = task.GroupID; 741 UUID taskGroupID = task.GroupID;
742 bool groupdOwned = taskOwnerID == taskGroupID; 742 bool notGroupdOwned = taskOwnerID != taskGroupID;
743 743
744 // if friends with rights then owner 744 // if friends with rights then owner
745 if (!groupdOwned && IsFriendWithPerms(spID, taskOwnerID)) 745 if (notGroupdOwned && IsFriendWithPerms(spID, taskOwnerID))
746 { 746 {
747 returnMask = ApplyObjectModifyMasks(grp.EffectiveOwnerPerms, objflags, unlocked); 747 returnMask = ApplyObjectModifyMasks(grp.EffectiveOwnerPerms, objflags, unlocked);
748 returnMask |= EXTRAOWNERMASK; 748 returnMask |= EXTRAOWNERMASK;
@@ -756,47 +756,37 @@ namespace OpenSim.Region.CoreModules.World.Permissions
756 ulong powers = 0; 756 ulong powers = 0;
757 if(taskGroupID != UUID.Zero && GroupMemberPowers(taskGroupID, sp, ref powers)) 757 if(taskGroupID != UUID.Zero && GroupMemberPowers(taskGroupID, sp, ref powers))
758 { 758 {
759 // shared as priority over group roles 759 if(notGroupdOwned)
760 bool notShared = (grp.EffectiveGroupPerms & SHAREDMASK) == 0;
761 if(groupdOwned && notShared)
762 { 760 {
763 // object is owned by group, check role powers 761 // group sharing or everyone
764 if((powers & (ulong)GroupPowers.ObjectManipulate) == 0) 762 returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
765 { 763 if (taskOwnerID != UUID.Zero)
766 // group sharing or everyone 764 returnMask |= (uint)PrimFlags.ObjectAnyOwner;
767 returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
768 returnMask |=
769 (uint)PrimFlags.ObjectGroupOwned |
770 (uint)PrimFlags.ObjectAnyOwner;
771 return returnMask;
772 }
773
774 // we may have copy without transfer
775 uint grpEffectiveOwnerPerms = grp.EffectiveOwnerPerms;
776 if((grpEffectiveOwnerPerms & (uint)PermissionMask.Transfer) == 0)
777 grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy;
778 returnMask = ApplyObjectModifyMasks(grpEffectiveOwnerPerms, objflags, unlocked);
779 returnMask |=
780 (uint)PrimFlags.ObjectGroupOwned |
781 (uint)PrimFlags.ObjectAnyOwner;
782 if((returnMask & (uint)PrimFlags.ObjectModify) != 0)
783 returnMask |= (uint)PrimFlags.ObjectOwnerModify;
784 return returnMask; 765 return returnMask;
785 } 766 }
786 else 767
768 // object is owned by group, check role powers
769 if((powers & (ulong)GroupPowers.ObjectManipulate) == 0)
787 { 770 {
788 // group sharing or everyone 771 // group sharing or everyone
789 returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked); 772 returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
790 if(groupdOwned) 773 returnMask |=
791 { 774 (uint)PrimFlags.ObjectGroupOwned |
792 returnMask |= 775 (uint)PrimFlags.ObjectAnyOwner;
793 (uint)PrimFlags.ObjectGroupOwned |
794 (uint)PrimFlags.ObjectAnyOwner;
795 }
796 else if (taskOwnerID != UUID.Zero)
797 returnMask |= (uint)PrimFlags.ObjectAnyOwner;
798 return returnMask; 776 return returnMask;
799 } 777 }
778
779 // we may have copy without transfer
780 uint grpEffectiveOwnerPerms = grp.EffectiveOwnerPerms;
781 if((grpEffectiveOwnerPerms & (uint)PermissionMask.Transfer) == 0)
782 grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy;
783 returnMask = ApplyObjectModifyMasks(grpEffectiveOwnerPerms, objflags, unlocked);
784 returnMask |=
785 (uint)PrimFlags.ObjectGroupOwned |
786 (uint)PrimFlags.ObjectYouOwner;
787 if((returnMask & (uint)PrimFlags.ObjectModify) != 0)
788 returnMask |= (uint)PrimFlags.ObjectOwnerModify;
789 return returnMask;
800 } 790 }
801 791
802 // fallback is everyone rights 792 // fallback is everyone rights
@@ -898,17 +888,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
898 888
899 if (group.IsAttachment) 889 if (group.IsAttachment)
900 return 0; 890 return 0;
901
902 if (IsFriendWithPerms(currentUser, objectOwner))
903 return group.EffectiveOwnerPerms & lockmask;
904 891
905 UUID sogGroupID = group.GroupID; 892 UUID sogGroupID = group.GroupID;
893 bool notgroudOwned = sogGroupID != objectOwner;
894
895 if (notgroudOwned && IsFriendWithPerms(currentUser, objectOwner))
896 return group.EffectiveOwnerPerms & lockmask;
897
906 ulong powers = 0; 898 ulong powers = 0;
907 if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, currentUser, ref powers)) 899 if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, currentUser, ref powers))
908 { 900 {
909 bool Shared = (group.EffectiveGroupPerms & SHAREDMASK) != 0; 901 if(notgroudOwned)
910
911 if(Shared || sogGroupID != objectOwner)
912 return group.EffectiveGroupOrEveryOnePerms & lockmask; 902 return group.EffectiveGroupOrEveryOnePerms & lockmask;
913 903
914 if((powers & (ulong)GroupPowers.ObjectManipulate) == 0) 904 if((powers & (ulong)GroupPowers.ObjectManipulate) == 0)
@@ -955,16 +945,16 @@ namespace OpenSim.Region.CoreModules.World.Permissions
955 if (group.IsAttachment) 945 if (group.IsAttachment)
956 return 0; 946 return 0;
957 947
958 if (IsFriendWithPerms(spID, objectOwner)) 948 UUID sogGroupID = group.GroupID;
949 bool notgroudOwned = sogGroupID != objectOwner;
950
951 if (notgroudOwned && IsFriendWithPerms(spID, objectOwner))
959 return group.EffectiveOwnerPerms & lockmask; 952 return group.EffectiveOwnerPerms & lockmask;
960 953
961 UUID sogGroupID = group.GroupID;
962 ulong powers = 0; 954 ulong powers = 0;
963 if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, sp, ref powers)) 955 if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, sp, ref powers))
964 { 956 {
965 bool Shared = (group.EffectiveGroupPerms & SHAREDMASK) != 0; 957 if(notgroudOwned)
966
967 if(Shared || sogGroupID != objectOwner)
968 return group.EffectiveGroupOrEveryOnePerms & lockmask; 958 return group.EffectiveGroupOrEveryOnePerms & lockmask;
969 959
970 if((powers & (ulong)GroupPowers.ObjectManipulate) == 0) 960 if((powers & (ulong)GroupPowers.ObjectManipulate) == 0)