Skip to content

allowClientClassCreation is not working #4527

Closed
@Nisthar

Description

@Nisthar

I used https://github.com/parse-community/parse-server-example to host my parse server on heroku.

I have edited my index.js file:

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',  // Don't forget to change to https if needed
  liveQuery: {
    classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
  },
  enableAnonymousUsers: process.env.ANON_USERS || false,
  allowClientClassCreation: process.env.CLIENT_CLASS_CREATION || false
});

I added CLIENT_CLASS_CREATION and set it to false.

My parse client is android. I am using this code:

 Parse.enableLocalDatastore(this);
        Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
        Parse.initialize(new Parse.Configuration.Builder(this)
                .applicationId(getString(R.string.parse_app_id))
                .server(getString(R.string.parse_server_url))
                .build()
        );
 FacebookSdk.sdkInitialize(getApplicationContext());
        ParseFacebookUtils.initialize(this);

 ParseACL defaultACL = new ParseACL();
        defaultACL.setPublicReadAccess(true);
        defaultACL.setPublicWriteAccess(false);
        ParseACL.setDefaultACL(defaultACL, true);

        ParseObject object = new ParseObject("app3");
        object.put("user","TestUser");

        object.saveEventually(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null) {
                    Log.i("Parse","SUCCESS");
                } else {
                    Log.i("Parse","FAILED");
                    e.printStackTrace();
                }
            }
        });

The query should fail. But its giving me SUCESS

What am i missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions