Skip to content

Commit e2ef3ab

Browse files
authored
[Timepoint List] Hide visits that are from user unaffiliated projects (#8723)
Adjusted the Timepoint_List module to also filter out the visits of projects that are not affiliated to the current user when they have permission to all sites. Resolves #8710
1 parent c88bcc4 commit e2ef3ab

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

modules/candidate_profile/test/TestPlan.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ that widget (ie. the media module for CandID 587630 (DCC090) or CandID 300001 (M
5050
4. Ensure that, when the module which added the extra `CandidateInfo` terms
5151
is disabled, the terms from that module no longer show up in the
5252
`Candidate Info` card.
53+
5. Ensure that you can always only see visits from projects that you are affiliated with.
5354

5455
All other widgets are part of other modules, and should be tested as
5556
part of that module's testing.

modules/timepoint_list/php/timepoint_list.class.inc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,12 @@ class Timepoint_List extends \NDB_Menu
9999
},
100100
$listOfSessionIDs,
101101
);
102-
103-
if ($user->hasPermission('access_all_profiles') === false) {
104-
$listOfTimePoints = array_filter(
105-
$listOfTimePoints,
106-
function ($timePoint) use ($user) {
107-
return $timePoint->isAccessibleBy($user);
108-
}
109-
);
110-
}
102+
$listOfTimePoints = array_filter(
103+
$listOfTimePoints,
104+
function ($timePoint) use ($user) {
105+
return $timePoint->isAccessibleBy($user);
106+
}
107+
);
111108

112109
/*
113110
* List of visits

modules/timepoint_list/test/TestPlan.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- For a candidate of a different site than your user, ensure that either
66
- `access_all_profiles` permission is required
77
- or that the candidate's registration site is the same as the user's site
8+
- Ensure that you can always only see visits from projects that you are affiliated with.
89
2. **Action buttons**
910
- For a candidate of a different site than your user, attempt to access the timepoint list via the url. The page should load with a message of 'Permission Denied'.
1011
- For a candidate of the same site as your user, there should be up to 3 additional buttons:

0 commit comments

Comments
 (0)