How to create permission only read in one collection and only read in another collection on flexible sync?(JAVA SDK)

I would like to know how to limit a collection to read-only and another to write-only, I made a rule in flexible but I am not able to implement a signature that follows these rules can anyone help me?

{
  "rules": {
    "AnalysisModel": [
      {
        "name": "anyperson",
        "applyWhen": {},
        "read": false,
        "write": true
      }
    ],
    "CoordinatesModel": [
      {
        "name": "anyperson",
        "applyWhen": {},
        "read": false,
        "write": true
      }
    ],
    "UserModel": [
      {
        "name": "anyperson",
        "applyWhen": {},
        "read": true,
        "write": true
      }
    ]
  },
  "defaultRoles": [
    {
      "name": "read-write",
      "applyWhen": {},
      "read": true,
      "write": true
    }
  ]
}

rule implemented in atlas

Credentials credentials = Credentials.anonymous();

            User userSync = app.login(credentials);

            SyncConfiguration config = new SyncConfiguration.Builder(userSync)
                    .initialSubscriptions(new SyncConfiguration.InitialFlexibleSyncSubscriptions() {
                        @Override
                        public void configure(Realm realm, MutableSubscriptionSet subscriptions) {

                            subscriptions.addOrUpdate(Subscription.create("anyperson",realm.where(UserModel.class)));

                        }
                    })
                    .allowQueriesOnUiThread(true)
                    .allowWritesOnUiThread(true)
                    .modules(new ModuleUserAndAnalysis())
                    .build();
            Realm.getInstanceAsync(config, new Realm.Callback() {
                @Override
                public void onSuccess(Realm realm) {
                    Log.v("EXAMPLE", "Successfully opened a realm.");
                }
            });

            realmConfig = config;

            return Realm.getInstance(realmConfig);
signature