parse.com - How to prevent user editing a specific column while still having write access to the object on Parse? -


I have some specific columns on my _User class which I only want to edit on the master key Server Side My user has the facility to write to myself, for example, there is a way to prevent my user from editing specific columns, for example, suppose I have a user object and I want to Users scatter their points:

  Before trigger: if (points area has been changed by user) {response.error (); )  

This should not be done before saving the trigger, but I am very concerned that there is no other point to check such "dirty" columns, if any. Do I have a way to achieve something (except for a clear solution, such as creating a new class, setting it to ACL to none, making a user pointer and a numeric column and editing, which is with the master key )?

here

{boolean} is dirty

If this object has been modified since the last save / refresh, then it becomes correct. If an attribute is specified, then it returns only when that special feature has been modified with last save / refresh.

Parameter: {String} attr

An attribute name (optional).

Returns: {Boolean}

If you add that couple (simultaneously calling dirty ("score") ), then You want what you want.

Modify objects on Save

In some cases, you do not want to throw away invalid data. You want a little bit before saving it. First Save also can handle this issue. You simply call the response to the object.

In our film review example, we want to ensure that the comments are not too long, it may be difficult to display a single long comment. We can use the first save to reduce the 140 characters before the comment:

  pars.cloud.bighvieve ("review", function (request, response) {Var Comment = request.object ("Comment"); if (comment.length & gt; 140) {// Tap and Add ... request.object.set ("comment", comment.substring (0, 137) ) + "...");} Response.success ();});  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -