Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
17 | public function getViewStatusFilter(): array |
||
18 | { |
||
19 | // Filter by what the user is allowed to see |
||
20 | $viewIDs = ['null']; // null is always an option as that means publicly visible |
||
21 | $member = Security::getCurrentUser(); |
||
22 | if ($member && $member->exists()) { |
||
23 | // Member is logged in, thus allowed to see these |
||
24 | $viewIDs[] = 'LoggedIn'; |
||
25 | |||
26 | /** @var DataList|Group[] $groups */ |
||
27 | $groups = Security::getCurrentUser()->Groups(); |
||
28 | if ($groups->count()) { |
||
29 | $viewIDs = array_merge($viewIDs, $groups->column('Code')); |
||
30 | } |
||
31 | } |
||
32 | |||
33 | return $viewIDs; |
||
34 | } |
||
36 |