Created
July 3, 2014 13:13
-
-
Save niraj-shah/f34a820a9d62064a1322 to your computer and use it in GitHub Desktop.
Parse.com JavaScript SDK - ACL Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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