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

fix: simplify meteor collection auth checks #41

Draft
wants to merge 1 commit into
base: bbc-release52
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions meteor/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

# but you can also edit it by hand.

meteor@2.0.1
[email protected].3
meteor@2.1.0-beta311.1
[email protected].4
[email protected]

mongo@2.0.2 # The database Meteor supports right now
mongo@2.1.0-beta311.1 # The database Meteor supports right now

[email protected].9 # Enable ECMAScript2015+ syntax in app code
typescript@5.4.3 # Enable TypeScript syntax in .ts and .tsx modules
[email protected].10 # Enable ECMAScript2015+ syntax in app code
typescript@5.6.3 # Enable TypeScript syntax in .ts and .tsx modules

[email protected] # Meteor's client-side reactive programming library

Expand Down
2 changes: 1 addition & 1 deletion meteor/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[email protected]
[email protected].1-beta.1
14 changes: 7 additions & 7 deletions meteor/.meteor/versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
allow-deny@2.0.0
allow-deny@2.1.0-beta311.1
[email protected]
[email protected]
[email protected]
Expand All @@ -8,9 +8,9 @@ [email protected]
[email protected]
[email protected]
[email protected]
ddp-client@3.0.3
ddp-client@3.1.0-beta311.1
[email protected]
ddp-server@3.0.3
ddp-server@3.1.0-beta311.1
[email protected]
[email protected]
[email protected]
Expand All @@ -24,24 +24,24 @@ [email protected]
[email protected]
[email protected]
[email protected]
meteor@2.0.2
meteor@2.1.0-beta311.1
[email protected]
[email protected]
[email protected]
[email protected]
mongo@2.0.3
mongo@2.1.0-beta311.1
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].2-beta311.1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
socket-stream-client@0.5.3
socket-stream-client@0.6.0-beta311.1
[email protected]
[email protected]
[email protected]
Expand Down
12 changes: 5 additions & 7 deletions meteor/server/collections/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,11 @@ function setupCollectionAllowRules<DBInterface extends { _id: ProtectedString<an

const { /* insert: origInsert,*/ update: origUpdate /*remove: origRemove*/ } = args

// These methods behave weirdly, we need to mangle this a bit.
// See https://github.com/meteor/meteor/issues/13444 for a full explanation
const options: any /*Parameters<Mongo.Collection<DBInterface>['allow']>[0]*/ = {
update: () => false,
updateAsync: origUpdate
? (userId: string | null, doc: DBInterface, fieldNames: string[], modifier: any) =>
origUpdate(protectString(userId), doc, fieldNames as any, modifier) as any
const options: Parameters<Mongo.Collection<DBInterface>['allow']>[0] = {
update: origUpdate
? async (userId: string | null, doc: DBInterface, fieldNames: string[], modifier: any) => {
return origUpdate(protectString(userId), doc, fieldNames as any, modifier)
}
: () => false,
}

Expand Down
Loading