Repository navigation
Let "All Assessments" users see every assessment in the queue and search - #151
Merged
Merged
Conversation
The per-user Access Level (Admin > Users) offers "Only Assessments Owned by User", "Team Assessments" and "All Assessments", but the assessment queue and the app/name search still restricted every non-manager to their own assessments. Opening an assessment directly already honoured the level, so a user on "All Assessments" could reach work the queue never listed. getAllAssessments() and getAssessmentsByAppDesc() now add the "assessor = me" clause only for the user-only level. "Team Assessments" is applied by the existing hasTeam() filter, and "All Assessments" sees everything, manager or not. Managers are unaffected. Adds AssessmentQueriesAccessLevelTest, a MongoDB-backed test covering the queue and search results for each level.
Non-managers on the Team Assessments or All Assessments access level now get an "Only my assessments" checkbox in the queue filters, checked by default, so the queue still opens on their own work and they widen it on purpose instead of landing on the manager view. Unticking it reloads the queue with onlyMine=false, carried along with the other filters and the status poll so the rows and their report icons stay in step. Managers keep the full queue with no checkbox; user-only accounts have nothing to widen and get none. AssessmentQueries.getAllAssessments() gains an onlyMine overload; the queue action and the status servlet decide the scope through AssessmentQueue.restrictToMine(), covered by AssessmentQueueScopeTest and new cases in AssessmentQueriesAccessLevelTest.
The banner keyed off the engagement permission, so it appeared for anyone with that flag even when the queue was limited to their own assessments, and it would have labelled a non-manager who unticked "Only my assessments" as the manager view. It now shows only when a manager is viewing the full queue; widened non-manager queues get the help-text note instead.
summitt
added a commit
that referenced
this pull request
Nov 23, 2026
…155) * Let assessors open and update assessments their Access Level covers Since #151 the queue lists every assessment a user's Access Level allows, but the assessment pages still only loaded assessments the user was assigned to. A non-manager opening a teammate's assessment got an empty page that crashed in Top.jsp (IndexOutOfBounds on the empty risk levels); the global exception mapping then re-rendered through the half-written page and Tomcat answered 500 "Stream closed", hiding the real error. Access now follows the Access Level, so an assessor can take over work a teammate can't finish: - "All Assessments" (also the default when none is set) opens and updates every assessment; - "Team Assessments" opens and updates the team's assessments; - "Only Assessments Owned by User" keeps to the user's own. Assigned assessors keep access to their own finalized assessments, and finalized assessments stay read-only. Managers still open any assessment; a manager who also has the assessor role can now update the ones their Access Level covers, like any other assessor. AssessmentQueries gains canOpenAssessment, canEditAssessment and getAssessmentForUser. The assessment page, notes, history, stats, custom fields, send-to-peer-review, report upload, vulnerability edits and checklist edits use them. The checklist edits previously checked nothing beyond the assessor role. An assessment the user may not open now gets 403 Access Denied, recorded in the audit log, instead of a 500. * Update the section test to match getSection() keeping underscores #148 made getSection() return the stored key, with underscores, since the report templates match on it; getSectionPretty() is the display form. The test still expected spaces and has failed on every branch since. Signed-off-by: Josh <ascetik@gmail.com> --------- Signed-off-by: Josh <ascetik@gmail.com>
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.
Summary
The per-user Access Level (Admin > Users) offers Only Assessments Owned by User, Team Assessments and All Assessments, but the assessment queue and the app/name search restricted every non-manager to their own assessments regardless. Opening an assessment directly already honoured the level.
AssessmentQueries.getAllAssessments()andgetAssessmentsByAppDesc()now add theassessor = meclause only for the user-only level, or when the queue asks foronlyMine. Team Assessments is applied by the existinghasTeam()filter; All Assessments sees everything. Managers are unaffected.onlyMine=false, carried with the other filters and sent to the status poll so rows and report icons agree. Managers and user-only accounts see no checkbox.Verification
AssessmentQueriesAccessLevelTest(MongoDB-backed, 8 cases): queue and search results per access level, with and withoutonlyMine. Watched the new cases fail before each change.AssessmentQueueScopeTest(4 cases): who gets the checkbox and what the default restriction is.EntityUnitTest.testVulnerabilitySectionfailure.onlyMine=false, re-ticking returns to the default; user-only has no checkbox and ignores a forcedonlyMine=false; a manager has no checkbox and sees the full queue.