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

feat(siteLaunch): restrict to admin #873

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

kishore03109
Copy link
Contributor

@kishore03109 kishore03109 commented Aug 2, 2023

Problem

No access controls for admins, can be reviewed with fe pr.

Solution

Only admins can call the BE route.

Comment on lines 268 to 272
const isAdmin = email.endsWith(".gov.sg")

if (!isAdmin) {
return errAsync(new SiteLaunchError("Not authorized to launch site"))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking, is there a reason why we don't attach the checkIsSiteAdmin middleware to this instead (so checking for site admin, rather than just checking the email)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O.o Derp moment
ae851f7

Copy link
Contributor

@alexanderleegs alexanderleegs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kishore03109 kishore03109 merged commit 2db20a0 into develop Aug 2, 2023
@mergify mergify bot deleted the IS-348-BE-only-admins-can-launch-site branch August 2, 2023 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants