Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4/**
5 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 */
8
9namespace OCA\Libresign\Service\Policy;
10
11use OCP\IUser;
12
13interface IPolicyAuthorizationService {
14    /**
15     * Check if the user can manage group policies.
16     *
17     * Instance admins and subadmins can manage group policies.
18     * Regular users cannot.
19     */
20    public function canUserManageGroupPolicies(?IUser $user): bool;
21
22    /**
23     * Get list of group IDs manageable by the given user.
24     *
25     * For instance admins: returns empty (they manage all groups at policy level).
26     * For subadmins: returns subadmin-managed groups restricted by the effective
27     * request-sign policy scope (allow + deny concatenated).
28     * For regular users: returns empty.
29     *
30     * @return list<string>
31     */
32    public function getManageablePolicyGroupIds(?IUser $user): array;
33}