Skip to content

Commit

Permalink
BRS-806 non-sysadmins cant access facilities (#175)
Browse files Browse the repository at this point in the history
* BRS-806 non-sysadmins cant access facilities

* BRS-806 - public should NOT be auth
  • Loading branch information
cameronpettit authored Sep 1, 2022
1 parent 9d8c453 commit 01eed07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lambda/readReservation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ exports.handler = async (event, context) => {
logger.debug('**SYSADMIN**');
} else {
logger.debug('**AUTHENTICATED, NOT SYSADMIN**');
let parkObj = await getPark(park.sk, true);
let parkObj = await getPark(park, true);

// Check roles.
logger.debug('Roles:', permissionObject.roles);
parkObj = await roleFilter(park, permissionObject.roles);
parkObj = await roleFilter([parkObj], permissionObject.roles);

// If user does not have correct park role, then they are not authorized.
if (park.length < 1) {
if (parkObj.length < 1) {
return sendResponse(403, { msg: 'Unauthorized' }, context);
}
}
Expand Down

0 comments on commit 01eed07

Please sign in to comment.