Created
June 16, 2015 03:19
-
-
Save kjs3/047c1a2467a6d62bf223 to your computer and use it in GitHub Desktop.
Trying to set Parse User ACL
This file contains 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
var user = new Parse.User({ | |
name: name, | |
username: email, | |
email: email, | |
password: password | |
}); | |
user.signUp().then( | |
function() { | |
var user = Parse.User.current(); | |
if ( user ) { | |
var customACL = new Parse.ACL(user); | |
customACL.setRoleWriteAccess(false); | |
customACL.setPublicWriteAccess(false) | |
user.setACL(customACL); | |
} | |
this.transitionTo('home'); | |
}.bind(this), | |
function(error) { | |
// Show the error message somewhere and let the user try again. | |
alert("Error: " + error.code + " " + error.message); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment