Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007898opensim[REGION] OpenSim Corepublic2016-05-03 14:092016-06-21 09:56
ReporterMandarinka Tasty 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformUnixOSUnix 3.14.32.6OS Version64-bit
Product Version 
Target VersionFixed in Version 
Summary0007898: Correction for fix - Estate Manager can set parcels for sale
DescriptionHello Melanie :)

You have resolved report: http://opensimulator.org/mantis/view.php?id=7857 [^]

and set commit: 1e44aba6207cf83e3d4d0f2437053dc64cc30f78

but I have written in last sentences, that even if

we set bool allowEstateManager = true in here:
return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandSetSale, true);

then still I observe, estate manager can't buy parcel.

I did not want to write about it at once you had published, because i wanted to find solution and offer it

I have analysed:

protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager)

and condition inside of it:

if (allowEstateManager && IsEstateManager(user))

and unfortunately this logic AND does not want to be equal TRUE, even

if we have assigned allowEstateManager value true and

bool IsEstateManager(user) = true, too.

I was suprised, but i have verified and really , it does not want to give true, in this logic AND.

Hence estate manager can't purchase the parcel.

I have found reason, though I'm not C# expert.

In this condition, that we consider, my compilator says:

allowManagerEstate is (paramater)bool allowEstateManager, and

IsEstateManager is a bool,

and in this way , (parameter)bool && bool is not true, even if both sides are true.
I do not know why it happens, but it does. i have compiled region and verified it.

Solution is = applying this condition in such way:

if ((allowEstateManager = true) && IsEstateManager(user))

Then all works, I have verified and compiled simulator and Estate Manager can purchase the parcel, finally )

So You can add, to commit: 1e44aba6207cf83e3d4d0f2437053dc64cc30f78

this condition, I have written now, I hope :)

Regards :)


TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentMono / Linux64
Mono VersionOther
Viewer
Attached Filespatch file icon 0001-Giving-Permissions-to-EM-to-set-parcel-for-sale-when.patch [^] (1,874 bytes) 2016-06-19 20:38 [Show Content]

- Relationships

-  Notes
(0030269)
melanie (administrator)
2016-05-03 19:49

allowEstateManager = true will MAKE it rue because of the single equals sign. Again you are suggesting a "fix" that has overly broad consequences because the code you posted results in allowEstateManager to beCOME true because a single = is and assignment, not a comparison. The issue here would be to determine why the allowEstateManager value isn't true es expected.

A great tool to debug such issues is the call stack, as it shows where code execution goes.

Putting:

Console.WriteLine(Environment.StackTrace);

somewhere in the code shows which functions are being called by which other functions. Of course you need to run OpenSim with mono --debug to get the benefot of this but it may help you in determining causes without experiments like your current one.

No, what you propose is not a solution. Please find out why it's not working for you with the code I pushed because it WorksForMe(tm)
(0030270)
Mandarinka Tasty (reporter)
2016-05-03 22:51
edited on: 2016-05-04 13:36

ok. Thank You for the hint, I did not know about this:
Console.WriteLine(Environment.StackTrace);

I'm going to use it in my configuration.

In your region, where it works for You,

variable: region_manager_is_god = false ?

I'm asking because that is the main assumption of my report.

I'm not experimenting with this report in my grid production, where I use unix.

I do tests using windows visual 2010 C# studio express at home pc,

before I verify it in grid environment.

can it be problem here that I use Microsoft compilator,

that recognizes allowEstateManager not as a bool, but parameter that passes the bool ?

(0030271)
Mandarinka Tasty (reporter)
2016-05-04 13:45

I'm just loudly thinking now. Maybe CanEditParcelProperties has influence on it.

Because when EM ( with region_manager_is_god = false ) opens about land window to set the parcel for sale, then it is also like editing of parcel's properties.

But i am not sure in 100%, though i have noticed such lines, when i used:

Console.WriteLine(Environment.StackTrace);

And because in CanEditParcelProperties, we have return to

GenericParcelOwnerPermission with AllowEstateManeger = false

then maybe it makes conflict in same time, with AllowEstateManager = true passed

to GenericParcelOwnerPermission from CanSellParcel ??

If EM is reigon god, then all issues dissappear, because, service of EM in
GenericParcelOwnerPermission is made by IsAdministrator bool, and

IsEstateManager is not taken under consideration in this moment.

I do not know how you have set: region_manager_is_god = .

If true, then it is obvious why it works for You, but if false, as it is our topic, then it frustrates me, that it works for you and not for me.
(0030272)
Mandarinka Tasty (reporter)
2016-05-04 14:34

I have even made such experiment:

Inside CanEditParcelProperties , I assigned true to bool AllowManager

in return to GenericParcelOwnerPermission:

return GenericParcelOwnerPermission(user, parcel, (ulong)p, true);



and it worked for me: EM could purchase the parcel.

So now, I have set such thing inside private bool CanEditParcelProperties:

if (IsEstateManager(user))
            {
                return GenericParcelOwnerPermission(user, parcel, (ulong)p, true);
            }

            return GenericParcelOwnerPermission(user, parcel, (ulong)p, false);

means, when user is EstateManager ( without god power)

then AllowManager true is passed to GenericParcelOwnerPermission

and when is not, then false goes.

What do you think about it ?

So to make resume we have:


private bool CanSellParcel(UUID user, ILandObject parcel, Scene scene)
        {
            DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
            if (m_bypassPermissions) return m_bypassPermissionsValue;

            return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandSetSale, true);
        }

and

private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager)
        {
            DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
            if (m_bypassPermissions) return m_bypassPermissionsValue;

            if (IsEstateManager(user))
            {
                return GenericParcelOwnerPermission(user, parcel, (ulong)p, true);
            }

            return GenericParcelOwnerPermission(user, parcel, (ulong)p, false);
        }

and in protected bool GenericParcelOwnerPermission

 if (allowEstateManager & IsEstateManager(user))
            {
                return true;
            }

What Do you think about it ? Certainly once again, I remind all we discuss udner this :

region_manager_is_god = false

I accept creative criticism :)
(0030273)
melanie (administrator)
2016-05-04 14:57

You may be on to something there, although this isn't what should happen. I'll have to read some more viewer code to see what the viewer accepts in what state.

There are some issues where, depending on the user level, the viewer will make assumptions that can backfire badly, like when changing the parcel name the "Show in search" would clear by itself (that bug is long fixed). This only goes to show that there are more things between the skydome and Z==0 than we can know :)
(0030274)
Mandarinka Tasty (reporter)
2016-05-04 15:40

Yes :) I realsie that and agree with You, that it can be such Pandora box hidden in background of those issues:)

And i appreciate such considerations a lot.

Anyway to give You even more info:

I have also, in my experimental config, added such condition inside CanAbandaParcel:

if (IsEstateManager(user))
            {
                return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, true);
            }

            return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false);

to make Estate Manager ( without god power ) to abandon parcel belonging to tenant.

Reclaiming is reserved only for Estate Owner, but our Estate Manager = representative of EO, should also have power to abandon parcel belonging to tenant, who assume, is too long in arrears :)

So for me, but you need to consider and decide, it looks that

passing allowEstateManager with different logical values in same time, from different parts of code, makes problem for server, to decide, what is true or false.

So now I eventually stop to dig in PermissionsModule.cs and go to other part code and will be lookign forward Your investigations :)

Regards
(0030591)
Mandarinka Tasty (reporter)
2016-06-19 20:41

I've added the patch, I was mentioning about earlier.

It looks, that actually, still when variable:

region_manager_is_god = false in OpenSim.ini

Estate Manager = EM is not able to set parcel for sale, when parcel is owned by

Estate Owner = EO

And additionally EM is not able to abandon parcel owned by the Tenant to EO.

My patch solves those problems. I think that we could give it a try :)
(0030625)
Diva (administrator)
2016-06-21 09:56

@Melanie can you please look at this

- Issue History
Date Modified Username Field Change
2016-05-03 14:09 Mandarinka Tasty New Issue
2016-05-03 19:49 melanie Note Added: 0030269
2016-05-03 22:51 Mandarinka Tasty Note Added: 0030270
2016-05-04 13:36 Mandarinka Tasty Note Edited: 0030270 View Revisions
2016-05-04 13:45 Mandarinka Tasty Note Added: 0030271
2016-05-04 14:34 Mandarinka Tasty Note Added: 0030272
2016-05-04 14:57 melanie Note Added: 0030273
2016-05-04 15:40 Mandarinka Tasty Note Added: 0030274
2016-06-19 20:38 Mandarinka Tasty File Added: 0001-Giving-Permissions-to-EM-to-set-parcel-for-sale-when.patch
2016-06-19 20:41 Mandarinka Tasty Note Added: 0030591
2016-06-21 09:56 Diva Note Added: 0030625


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker