fix: restrict the developer boot context helper used by the POS and URY web - #241
Draft
esafwan wants to merge 1 commit into
Draft
fix: restrict the developer boot context helper used by the POS and URY web#241esafwan wants to merge 1 commit into
esafwan wants to merge 1 commit into
Conversation
…anagers Guests could retrieve full session boot data from the POS and URY dev boot-context endpoints whenever developer_mode was enabled, because the endpoints were whitelisted with allow_guest=True and gated only on developer_mode. Drop allow_guest and require an authenticated user with the System Manager role before returning boot data.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What it does / Summary
Restricts access to the
get_context_for_devAPI helper inury/www/pos.pyandury/www/ury.pyto authenticated users with the System Manager role.What it solves / Motivation
get_boot()) whendeveloper_modewas enabled.Key Technical Changes
ury/www/pos.py&ury/www/ury.py:allow_guest=Truefrom@frappe.whitelist(methods=["POST"]).frappe.PermissionErroriffrappe.session.user == "Guest"or"System Manager"is missing from the user's roles.