ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
OnlineStatusFilter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ilRbacReview;
24use Closure;
25
27{
31 public function __construct(
32 private readonly Closure $select_didnt_agree,
33 private readonly ilRbacReview $review
34 ) {
35 }
36
41 public function __invoke(array $users): array
42 {
43 $did_not_agreed = array_filter(
44 ($this->select_didnt_agree)($users),
45 fn(int $user) => $user !== SYSTEM_USER_ID && !$this->review->isAssigned($user, SYSTEM_ROLE_ID)
46 );
47
48 return array_values(array_diff($users, $did_not_agreed));
49 }
50}
__construct(private readonly Closure $select_didnt_agree, private readonly ilRbacReview $review)
class ilRbacReview Contains Review functions of core Rbac.
const SYSTEM_ROLE_ID
Definition: constants.php:29
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26