ParsePy icon indicating copy to clipboard operation
ParsePy copied to clipboard

save User using master key

Open yangqch opened this issue 9 years ago • 3 comments

When running server side background job, it is common to modify and save User attributes. Usually, with master_key registered, it should be no problem to run user.save() even if the program is not run by the logged in user.

However, in current version, it failed for "save requires a logged-in session" Error. It is caused by the decorator "login_required" on the "save()" function in User class. It will be helpful to check master key when login_required is not satisfied.

wdyt?

yangqch avatar Nov 23 '15 09:11 yangqch

we already have "master_key_required" defined but not used anywhere.

yangqch avatar Nov 23 '15 09:11 yangqch

oh, I just found a very hacky way to "solve" this problem. set user.sessionToken=something can just cheat the login_required() to pass.

I hope we can find a more formal way to achieve this.

yangqch avatar Nov 23 '15 09:11 yangqch

I'm running into the same issue. Hoping to have a resolution here.

maplethorpej avatar Aug 24 '16 04:08 maplethorpej