This repository was archived by the owner on Jul 27, 2025. It is now read-only.
fix: Only admins can generate invite codes#1611
Merged
zachgoll merged 2 commits intomaybe-finance:mainfrom Jan 24, 2025
Merged
Conversation
|
Hey, |
zachgoll
reviewed
Jan 13, 2025
Contributor
zachgoll
left a comment
There was a problem hiding this comment.
Thanks @tonyvince! Looks good, just a minor suggestion.
|
|
||
| def ensure_admin | ||
| redirect_to settings_hosting_path, alert: "You are not allowed to generate invite codes" unless Current.user.admin? | ||
| end |
Contributor
There was a problem hiding this comment.
I think since we're disabling the input in the UI, we should probably just throw an exception here. A user should not be able to trigger this POST request given the UI, so if they try to side-step that, they should receive an error I think.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #1606