Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created July 3, 2014 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save niraj-shah/f34a820a9d62064a1322 to your computer and use it in GitHub Desktop.
Save niraj-shah/f34a820a9d62064a1322 to your computer and use it in GitHub Desktop.
Parse.com JavaScript SDK - ACL Examples
// true = access allowed, false = not allowed
// create ACL
var acl = new Parse.ACL();
// public can read
acl.setPublicReadAccess( true );
// public cannot write
acl.setPublicWriteAccess( false );
// user can read data
acl.setReadAccess( Parse.User.current(), true );
// user can write data
acl.setWriteAccess( Parse.User.current(), true );
// save ACL to object
profile.setACL( acl );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment