Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created August 2, 2013 17:44
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niraj-shah/6141831 to your computer and use it in GitHub Desktop.
Save niraj-shah/6141831 to your computer and use it in GitHub Desktop.
Two examples of setting ACL controls using Parse JS SDK
// ACL to restrict write to user, and public read access
var custom_acl = new Parse.ACL();
// give write access to the current user
custom_acl.setWriteAccess( Parse.User.current(), true);
// give public read access
custom_acl.setPublicReadAccess(true);
GameObject.setACL(custom_acl);
// ACL to restrict write to user, and no public access
var custom_acl = new Parse.ACL();
// give write access to the current user
custom_acl.setWriteAccess( Parse.User.current(), true);
// disable public read access
custom_acl.setPublicReadAccess(false);
GameObject.setACL(custom_acl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment