Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save User using master key #129

Open
yangqch opened this issue Nov 23, 2015 · 3 comments
Open

save User using master key #129

yangqch opened this issue Nov 23, 2015 · 3 comments

Comments

@yangqch
Copy link

yangqch commented Nov 23, 2015

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
Copy link
Author

yangqch commented Nov 23, 2015

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

@yangqch
Copy link
Author

yangqch commented Nov 23, 2015

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.

@maplethorpej
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants