blob: 4f7004aae0a5a7d988780f0bf13b7c6d8c31bd3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Testing;
use OCP\Group\Backend\ABackend;
use OCP\Group\Backend\IHideFromCollaborationBackend;
class HiddenGroupBackend extends ABackend implements IHideFromCollaborationBackend {
private string $groupName;
public function __construct(
string $groupName = 'hidden_group',
) {
$this->groupName = $groupName;
}
public function inGroup($uid, $gid): bool {
return false;
}
public function getUserGroups($uid): array {
return [];
}
public function getGroups($search = '', $limit = -1, $offset = 0): array {
return $offset === 0 ? [$this->groupName] : [];
}
public function groupExists($gid): bool {
return $gid === $this->groupName;
}
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0): array {
return [];
}
public function hideGroup(string $groupId): bool {
return true;
}
}
|