Load relations from query stopped working

I’ve got simple query on frontend, for logged user, with load relations, like this:

Backendless.Data.of( “negotiations” ).findById( {objectId:neg_objectId, loadRelations:“inv_negotiations,inv_negotiations.inventory,inv_negotiations.inventory.equipment,crms_as_renter_opportunity,crms_as_supplier_opportunity,crms_sub_rent_supp”})

and all worked fine. Now same code give results without all those related fields!
I also tried more general query
let q = Backendless.DataQueryBuilder.create().setWhereClause( “objectId=’”+neg_objectId+"’" );
q.setRelated([“inv_negotiations,inv_negotiations.inventory,inv_negotiations.inventory.equipment,crms_as_renter_opportunity,crms_as_supplier_opportunity,crms_sub_rent_supp”]);
Backendless.Data.of(“negotiations”).find(q)

same effect - no related data.

when I’m trying same request in developer REST Console with CloudCode key - related data is loaded, but with javascript/rest keys - no related data

So, what’s changed? (I was on js sdk 6.2.12 but also tried latest 6.2.22 - no difference)
my app id is “4BAEABFC-6FEF-EB39-FFE3-162B0D48F300”

Hello @yuriy,

before Backendless 6.4.6 we do not check permissions when loading relations during the find operation (find, find by id, find first, find last). Now we check it. So the solution would be to assign proper permissions for Load Relations.

Regards,
Stanislaw

well, I think I have set correct permissions, by default it’s forbidden on the role level, but it’s explicitly set Yes in owner policy and data I’m trying to retrieve have same owner

Hello @yuriy

In your negotiation table
1.
PERMISSIONS → ROLES PERMISSIONS
ServerCodeUser - LOAD RELATIONS = GRANT (thats why with CloudCode key - related data is loaded)
RestUser - LOAD RELATIONS = DENY_INHERIT (thats why with javascript/rest keys - no related data)
JSUser - LOAD RELATIONS = DENY_INHERIT (thats why with javascript/rest keys - no related data)
2.
PERMISSIONS → OWNER POLICY
LOAD RELATIONS = GRANT
In order for the policy owner to be involved, you need to make a request from the logged in user, who is the owner for a specific record.

In order to get the data you need, you can:
Сhange
PERMISSIONS → ROLES PERMISSIONS → RestUser - LOAD RELATIONS = GRANT
PERMISSIONS → ROLES PERMISSIONS → JSUser - LOAD RELATIONS = GRANT
Or make a call from the logged in owner.

yes, but I’m trying to tell you that I am making a call from logged in owner

Hello @yuriy

Sorry, my mistake.

Yes, indeed, the OWNER POLICY is not taken into account now.
We are working on it.
Please see a more detailed answer - Permissions issue while loading relations - #5 by sergey.kuk

hmm, I see,
“the Backendless giveth and the Backendless taketh away”