How do I force {useMasterKey: true} by default on all queries/operations?

Hello, I’m building a small admin web interface where the admin has entire access to do anything and everything with parse objects. I’ve decided to use the master key during the initialization like

Parse.masterKey = ‘123456’;

Everything is good so far, but when I tried to save a different user object, it says “insufficient auth”. However, I overcame this problem by specifying this option to save function like (null, {useMasterKey: true});

I find it not so convenient to do this way because I’ve lot of query statements on a big codebase. I might probably have to do this on all my query/save statements. My question is, is there another way to force use master key on all operations by default on Parse JS API without manually including this option on each operation?

Any help is appreciated. Thank you.


I don’t think so. You’ll probably need to pass {useMasterKey: true} in all operations. Make sure that nobody that is not an “admin” has access to your frontend code. Otherwise they can easily find the master key in your code.