Permission Bug allowing me to add relations

Thanks for coming back Inna, I’m just trying to test now but getting a strange error I’ve not seen before, are you guys doing some maintenance?

We apologize for the inconvenience. Now we are solving this problem. We will notify you of the result.

Hello @Reece_Smith

The following logic is executed in your addBarComplaint method call:
the BarComplaints object is saved, where ownerId = UserID, that is, a new object is created, the owner of which is the user who calls this method.
In order to prohibit the addRelation, there are two options:

  1. Change the OWNER POLICY:
    a. Change OWNER POLICY for user:
    Data - Users - PERMISSIONS - OWNER POLICY - ADD / SET RELATION

    b. Change OWNER POLICY for table:
    Data - BarComplaints - PERMISSIONS - OWNER POLICY - ADD / SET RELATION
  2. Change the logic for the addBarComplaint method so that there is no owner in the created BarComplaints object or the owner is not the one who called this method.

Thanks Vladimir, I’ll test once the error is resolve:
400 - Service invocation failed: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value at [Source: (String)""{ “newComplaint”: { “complaint”: “Test Cosdfmp” }, “Bar_ID”: “15EB978F-B357-03C8-FF66-EC06EA19F400” }""; line: 1, column: 4] (14004)

@Reece_Smith we’ve just updated cloud servers with a fix for the issue you described above. Could you kindly let us know whether fix works for you well?

Regards

Inna,

Looks like you fixed the service invocation error but introduced a new issue. Running save with a string parameter seems to not feed into backendless:

Note the picture its sending over a Complaint with a value as expected, on save the object is created in backendless, but without the value for Complaint field:

Repo call on addBarComplaint:

{
"newComplaint": {
    "complaint": "Test Cosdfmp"
},
"Bar_ID": "15EB978F-B357-03C8-FF66-EC06EA19F400"

}

Please provide us your code snippet of this service.

public static Boolean addBarComplaint(BarComplaints newComplaint, String Bar_ID){
    String UserID = InvocationContext.getUserId();

    if( UserID != null ) {
        if(newComplaint.getComplaint() != null && !newComplaint.getComplaint().isEmpty()
            && !Bar_ID.isEmpty() && Bar_ID != null){
            try{
                newComplaint.save();

                return true;

            }
            catch (BackendlessException e){
                throw new BackendlessException(e.getMessage());
            }
        }
        else{
            throw new BackendlessException( "Empty Complaint!" );
        }
    }
    else{
        throw new BackendlessException( "1000", "User Not Logged In!" );
    }

}

}

same code as before, code hasn’t changed.

Something on backendless is causing the issue.

Thank you, we will investigate this and answer as soon as possible.

How’s it going?

@Inna_Shkolnaya @mark-piller Hi Both, any joy with this ticket?

I apologize for the long wait. Internal ticket BKNDLSS-22118 created.

Regards, Inna

Hello @Reece_Smith

newComplaint.save();
is
Backendless.Data.of( BarComplaints.class ).save( newComplaint );
?

Please, show what BarComplaints looks when return from Backendless.Data.of( BarComplaints.class ).save( newComplaint );

Hi @Volodymyr_Ialovyi,
.save is:
public BarComplaints save()
{
return Backendless.Data.of( BarComplaints.class ).save( this );
}

This is the result of the save:
image
Can see the object created and the create text.

What’s interesting is, I went into the Scheme on BarComplaints and changed ‘Complaint’ to ‘complaint’ (lowercase C) its definitely something going on with the case on transport. It worked find a few weeks ago so something has changed.

Here’s a snip-it of the BarComplaints class:

public class BarComplaints
{
  private Date updated;
  private String Complaint;
  private String objectId;
  private Date created;
  private String ownerId;
  public Date getUpdated()
  {
    return updated;
  }

  public String getComplaint()
  {
    return Complaint;
  }

  public void setComplaint( String Complaint )
  {
    this.Complaint = Complaint;
  }

  public String getObjectId()
  {
    return objectId;
  }

  public Date getCreated()
  {
    return created;
  }

  public String getOwnerId()
  {
    return ownerId;
  }

                                                    
  public BarComplaints save()
  {
    return Backendless.Data.of( BarComplaints.class ).save( this );
  }

Any luck @Volodymyr_Ialovyi

Hi, @Reece_Smith!

Can you try to change name of your column and field in model to lovercase?
Also can you update your libraries for server code model to latest version?

To download the latest libraries, please do the following:

1.Login to Backendless Console
2. Switch to the Business Logic screen
3. Select the CODING tab
4. Select JAVA
5. Click the blue download icon.

In “libs” directory you will find jars which must be copied to your project. Please, copy them to project “libs” directory and override existing jars in it. After that rebuild, redeploy your code and try to add new records using your service. Let me know if problem still be present after this actions will be taken.

By doing this actions you will help me to narrow down range of possible causes for this problem.

Regards, Andriy

Hi @Andriy_Konoz
Changing the column in the data scheme to lowercase does fix the problem, but this isn’t the solution as I’d then have to go through all of my apps and do a release with the new classes. The issue is it worked fine before and now it’s suddenly case sensitive.

I know that this is not solution for your problem. We aware about problem with Weborb serializer after 6.0.0 release. By asking you to make such test I am trying to understand if this problems caused by same bug or their causes are different.

Regards, Andriy

Hi @Reece_Smith!

Could you please create project with code to reproduce this problem using “bin” and “libs” directories from actual project in which problem occurs?
After doing so pack it to arhive and send it here.
We believe that problem can be caused by binaries version mismatch and such “test”-project will help us.

Regards, Andriy