Skip to content

Commit

Permalink
allow all users to use GetUsers
Browse files Browse the repository at this point in the history
  • Loading branch information
wrfhowell committed Apr 8, 2024
1 parent f526e4f commit 74d8f6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/users/createUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '../util/middleware/scopeHandler';

const db = getDatabase();
const validScopes = [ACCESS_SCOPES.ADMIN_WRITE, ACCESS_SCOPES.WRITE_PROFILE];

export const handler = new LambdaBuilder(router)
.use(new InputValidator())
Expand Down
13 changes: 2 additions & 11 deletions src/users/getUsers.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import { getDatabase } from '../util/db';
import { Authorizer } from '../util/middleware/authorizer';
import { InputValidator } from '../util/middleware/inputValidator';
import { IPersonQuery } from '../util/types/general';
import { LambdaBuilder, LambdaInput } from '../util/middleware/middleware';
import {
PaginationHelper,
ResponseMetaTagger,
} from '../util/middleware/paginationHelper';
import { APIResponse, SuccessResponse } from '../util/middleware/response';
import {
ACCESS_SCOPES,
ScopeController,
} from '../util/middleware/scopeHandler';
import { ScopeController } from '../util/middleware/scopeHandler';
import { IPersonQuery } from '../util/types/general';

const db = getDatabase();
const validScopes = [
ACCESS_SCOPES.ADMIN_READ,
ACCESS_SCOPES.READ_ALL_PROFILE_DATA,
];

const DEFAULT_LIMIT = 50;
const DEFAULT_OFFSET = 0;
Expand All @@ -31,8 +24,6 @@ export const handler = new LambdaBuilder(getUserRequest)
.build();

export async function getUserRequest(event: LambdaInput): Promise<APIResponse> {
ScopeController.verifyScopes(event.userScopes, validScopes);

if (event.pagination) {
const count = await countUsers();
event.pagination.count = count;
Expand Down

0 comments on commit 74d8f6d

Please sign in to comment.