Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
ActorRole
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 systemAdmin
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 groupAdmin
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 regularUser
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/**
6 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
7 * SPDX-License-Identifier: AGPL-3.0-or-later
8 */
9
10namespace OCA\Libresign\Service\Policy\Model;
11
12final class ActorRole {
13    public function __construct(
14        public readonly bool $canManageSystemPolicies,
15        public readonly bool $canManageGroupPolicies,
16        public readonly int $manageableGroupCount,
17    ) {
18    }
19
20    public static function systemAdmin(): self {
21        return new self(true, true, PHP_INT_MAX);
22    }
23
24    public static function groupAdmin(int $groupCount): self {
25        return new self(false, true, $groupCount);
26    }
27
28    public static function regularUser(): self {
29        return new self(false, false, 0);
30    }
31}