Skip to content

fix: enforce question-level permissions for questionary reads and updates - #1735

Open
janosbabik wants to merge 5 commits into
developfrom
fix-visit-template-role-handling
Open

fix: enforce question-level permissions for questionary reads and updates#1735
janosbabik wants to merge 5 commits into
developfrom
fix-visit-template-role-handling

Conversation

@janosbabik

Copy link
Copy Markdown
Contributor
  • Filter blank questionnaire steps according to the current user’s read permissions.
  • Prevent users from submitting answers to questions they are not permitted to access.
  • Ensure cleanup only affects omitted answers from questions the user can read.

@janosbabik
janosbabik requested a review from a team as a code owner August 21, 2026 13:35
@janosbabik
janosbabik requested review from TCMeldrum, ellen-wright and jekabs-karklins and removed request for a team and ellen-wright August 21, 2026 13:35
@janosbabik janosbabik changed the title fix: Enforce question-level permissions for questionary reads and updates fix: enforce question-level permissions for questionary reads and updates Aug 24, 2026
(answer) => answer.question.id === submittedAnswer.questionId
);

return currentAnswer != null && !hasQuestionReadPermission(currentAnswer);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: we should change && to ||. I have attached the issue as md file.

Additionally what claude found it is much easier to get all the question ids even without guessing because blankQuestionary is not Authed at all and returns all questions with their IDs

PR-1735-delete-hole-walkthrough.md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right, this needs to be changed. I will update it. Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants