I am using a custom authentication method for storing and retrieving data in the realm object server.
I would like the user to grant permission to other users.
String REALM_URL = "realm://" + OBJECT_SERVER_IP + ":" + OBJECT_SERVER_PORT + "/~/"
if (!userId.equalsIgnoreCase("userId")) {
UserCondition condition = UserCondition.keyValue("userId", "userId");
AccessLevel accessLevel = AccessLevel.WRITE;
PermissionRequest request = new PermissionRequest(condition, REALM_URL + companyId, accessLevel);
pm.applyPermissions(request, new PermissionManager.ApplyPermissionsCallback() {
@Override
public void onSuccess() {
Ln.d("Permission has been granted to sukumar");
}
@Override
public void onError(ObjectServerError error) {
Ln.d("Couldn't grant permission to sukumar" + error.getErrorMessage());
}
});
This is the error I am getting:
INVALID_PARAMETERS(601)
Your request parameters did not validate.
The custom auth takes in a userId
and a companyId
.