Skip to content

Commit 54e88d0

Browse files
committed
fix: simplify meteor collection auth checks
This removes some deprecation warnings See meteor/meteor#13444
1 parent deae44f commit 54e88d0

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

meteor/.meteor/packages

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
# but you can also edit it by hand.
1010

11-
meteor@2.0.1
12-
11+
meteor@2.1.0-beta311.1
12+
1313
1414

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

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

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

meteor/.meteor/release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

meteor/.meteor/versions

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
allow-deny@2.0.0
1+
allow-deny@2.1.0-beta311.1
22
33
44
@@ -8,9 +8,9 @@ [email protected]
88
99
1010
11-
ddp-client@3.0.3
11+
ddp-client@3.1.0-beta311.1
1212
13-
ddp-server@3.0.3
13+
ddp-server@3.1.0-beta311.1
1414
1515
1616
@@ -24,24 +24,24 @@ [email protected]
2424
2525
2626
27-
meteor@2.0.2
27+
meteor@2.1.0-beta311.1
2828
2929
3030
3131
32-
mongo@2.0.3
32+
mongo@2.1.0-beta311.1
3333
3434
3535
36-
36+
[email protected].2-beta311.1
3737
3838
3939
4040
4141
4242
4343
44-
socket-stream-client@0.5.3
44+
socket-stream-client@0.6.0-beta311.1
4545
4646
4747

meteor/server/collections/collection.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ function setupCollectionAllowRules<DBInterface extends { _id: ProtectedString<an
112112

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

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

0 commit comments

Comments
 (0)