config = $config; $this->secureRandom = $secureRandom; $this->groupManager = $groupManager; $this->timeFactory = $timeFactory; } /** * @return string[] */ public function getAllowedGroupIds(): array { $groups = $this->config->getAppValue('printer', 'allowed_groups', '[]'); $groups = json_decode($groups, true); return \is_array($groups) ? $groups : []; } public function isDisabledForUser(IUser $user): bool { $allowedGroups = $this->getAllowedGroupIds(); if (empty($allowedGroups)) { return false; } $userGroups = $this->groupManager->getUserGroupIds($user); return empty(array_intersect($allowedGroups, $userGroups)); } }