In the docs (https://docs.moralis.io/moralis-server/cloud-code/cloud-functions#more-advanced-validation)
it says:
Moralis.Cloud.beforeSave(Moralis.User, () => {
// any additional beforeSave logic here
}, {
fields: {
accType: {
default: 'viewer',
constant: true
},
},
});
that the field accType on Moralis.User will be ‘viewer’ on signup, and will be unchangeable, unless masterKey is provided.
Nonetheless, in the same cloud beforeSave
trigger, I am able to call
request.object.set("accType", "moderator");
successfully without a master key.
How is this possible?