Closed Sheeri closed 4 years ago
The functionality is correct for non-sandbox mode, but we should either update the docs to manually add insert permissions when setting up a sandbox (alternatively, and maybe better add a trigger on the Agency collection to automatically bootstrap a MenuData document when creating a new agency) – that Trigger can be run as system, which skips the rule checking
Docs on how to set up a sandbox are a good idea - and low priority. I have created https://github.com/WildAid/wildaid.github.io/issues/75 to capture what needs to be documented.
When trying to add menu data from the sandbox web ui, I was seeing behavior where the data did not appear to save.
The logs showed: role "Agency Admin" in "wildaid.MenuData" does not have insert permission for document with _id: ObjectID("5f753...034")
Under Rules -> mongodb-atlas -> Agency Admin role, the "Write" checkbox was selected but when I edited (with the pencil) I saw that only 'Search Documents" was checked, not "Insert Documents" (nor "Delete Documents").
I checked "Insert Documents" and hit SAVE and tried again, and this time my menu data saving worked.
Agency Admin at least needs Insert Documents privilege, at least until the new code to give default menu items is completed. If we decide we don't want Insert Documents, we will have to revoke the privilege in the sandbox environment.