Repository navigation
fix: SEC012 tells a microflow from a snippet of the same name - #2750
Merged
Merged
Conversation
A Marketplace module held a microflow and a snippet both named Lib.Overview. The SEC012 reach model keyed documents by qualified name alone, so a menu item calling the microflow reached the snippet without the execute check, and lint reported CE2729 on what the snippet shows for roles that cannot reach it. The walk's nodes are now kind and name, from refs.SourceType, the navigation columns and the permission element type. show references adds the target type when a name has more than one kind. Fixes #2730 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
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.
Fixes #2730 (upstream mendixlabs#2004).
Problem
A Marketplace module holds a microflow and a snippet both named
Lib.Overview. Execute access on the microflow is granted only toLib.Runner, and a menu item calls it. SEC012 then reported CE2729 on every attribute that the snippet's nested snippet shows, for every role withoutLib.Runner, which are exactly the roles that cannot reach it.mx checkreported 0 errors.show references to Lib.Overviewlisted the menu item beside the page using the snippet, with nothing to tell them apart.Cause: the SEC012 reach model keyed every document by its bare qualified name.
Lib.Overview(the microflow) was taken for the snippet. Its module was set, so the entry's execute check was skipped.Fix
PAGE,SNIPPET,MICROFLOW,NANOFLOW):refs.SourceType.HomePageType.show referencesadds aTargetTypecolumn when the name belongs to more than one kind of document. A name of one kind lists as before.Evidence
mdl/linter/rules/reachable_page_same_name_2730_test.goreported the false CE2729 before the fix. Its control, a viewable page holding the snippet, is still reported.mdl/executor/show_references_same_name_2730_test.gofailed both rows before the fix. Its control, one kind of document, gains no column.show referencesnow printsmenu_item … MICROFLOWandsnippet_call … SNIPPET.make ci-localpassed. The rule and reference tests were re-run on the new main.Generated by Claude Code