File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apps/meteor/app/api/server/helpers Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,6 @@ export async function parseJsonQuery(api: GenericRouteExecutionContext): Promise
3131 const queryFields = Array . isArray ( api . queryFields ) ? ( api . queryFields as string [ ] ) : [ ] ;
3232 const queryOperations = Array . isArray ( api . queryOperations ) ? ( api . queryOperations as string [ ] ) : [ ] ;
3333
34- if ( ! userId ) {
35- throw new Meteor . Error ( 'error-invalid-user' , 'Invalid user' ) ;
36- }
37-
3834 let sort ;
3935 if ( typeof params ?. sort === 'string' ) {
4036 try {
@@ -101,6 +97,10 @@ export async function parseJsonQuery(api: GenericRouteExecutionContext): Promise
10197 // Limit the fields by default
10298 fields = Object . assign ( { } , fields , API . v1 . defaultFieldsToExclude ) ;
10399 if ( route . includes ( '/v1/users.' ) ) {
100+ if ( ! userId ) {
101+ throw new Meteor . Error ( 'error-invalid-user' , 'Invalid user' ) ;
102+ }
103+
104104 if ( await hasPermissionAsync ( userId , 'view-full-other-user-info' ) ) {
105105 fields = Object . assign ( fields , API . v1 . limitedUserFieldsToExcludeIfIsPrivilegedUser ) ;
106106 } else {
You can’t perform that action at this time.
0 commit comments