Is there a way to set private the email
property of a PFUser
class, without having to set private the entire class?
Asked
Active
Viewed 84 times
0

rici
- 234,347
- 28
- 237
- 341

Guido Lodetti
- 739
- 2
- 8
- 20
-
What does making it private do? – kygcoleman Feb 25 '15 at 21:29
-
It doesn't allow public access. So, for example, an external user won't be able to see the user's email, but only his username – Guido Lodetti Feb 25 '15 at 21:31
-
What is *PFUser*, and what is a *PFUser class*? There's no description in the tag wiki, and neither of the other tags you've used have any application to this question AFAICT. – Ken White Feb 25 '15 at 21:43
-
1It's a question about Parse.com backend API service – race_carr Feb 26 '15 at 01:40
2 Answers
0
It's been requested for a few years over and over again to add the ability to do this but the Parse team has yet to release anything.

nick9999
- 601
- 1
- 8
- 22
0
If you place the email in a PrivateUserData subclass, the email can be private, but the password reset function can no longer work. Unless you set the email of the User object to be your own email and do something about it... :)
The following could make it work:
You could make a PublicUserData subclass and place all the user information that you intend to be able to be publicly read in that class, such as the username. Then, make the User subclass private. Anytime you want to access the User subclass to modify information, just log in the user.
var PublicUserData = Parse.Object.extend("PublicUserData");
var publicData = new PublicUserData();
publicData.set("username", username);
publicData.set("userId", user.id);
publicData.save(null, {
success: function(projectData) {
},
error: function(projectData, error) {
alert(error.message);
}
});

Toad22222
- 387
- 1
- 3
- 13