You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Making the permissions key unwritable
We'll be able to trust it more that way
* Document.save and Document.remove now check for embedded permissions first
- Removing the ability to call Model.remove() and Model.create() since those aren't compatible with how this library works.
4
-
-
4
+
- Muuuuch better tests
5
+
- Embedded permissions object cannot be overwritten
6
+
- When a document has embedded permissions, those permissions will be checks when a save or remove is being done. That way someone cannot write to an object in a way that changes their permssions and then try to save it.
Copy file name to clipboardExpand all lines: src/embedPermissions.js
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,14 @@ function embedPermissions(schema, options, authLevels, doc) {
12
12
thrownewError(`Cannot embed permissions into mongoose document at \`${permsKey}\`because the key is already present in the document. Please specify a custom key.`);
0 commit comments