2016-08-08 21:31:26 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2024-05-23 07:26:56 +00:00
|
|
|
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2016-08-08 21:31:26 +00:00
|
|
|
*/
|
2021-07-22 09:41:29 +00:00
|
|
|
|
2016-08-08 21:31:26 +00:00
|
|
|
namespace OCP\Settings;
|
|
|
|
|
2021-07-22 09:41:29 +00:00
|
|
|
use OCP\IUser;
|
|
|
|
|
2016-08-11 17:33:37 +00:00
|
|
|
/**
|
|
|
|
* @since 9.1
|
|
|
|
*/
|
2016-08-08 21:31:26 +00:00
|
|
|
interface IManager {
|
|
|
|
/**
|
|
|
|
* @since 9.1.0
|
2024-02-14 16:20:26 +00:00
|
|
|
* @deprecated 29.0.0 Use {@see self::SETTINGS_ADMIN} instead
|
2016-08-08 21:31:26 +00:00
|
|
|
*/
|
2020-04-10 14:54:27 +00:00
|
|
|
public const KEY_ADMIN_SETTINGS = 'admin';
|
2016-08-08 21:31:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @since 9.1.0
|
2024-02-14 16:20:26 +00:00
|
|
|
* @deprecated 29.0.0 Use {@see self::SETTINGS_ADMIN} instead
|
2016-08-08 21:31:26 +00:00
|
|
|
*/
|
2020-10-05 13:12:57 +00:00
|
|
|
public const KEY_ADMIN_SECTION = 'admin-section';
|
2016-08-08 21:31:26 +00:00
|
|
|
|
2017-05-19 10:11:07 +00:00
|
|
|
/**
|
2017-06-26 09:03:41 +00:00
|
|
|
* @since 13.0.0
|
2024-02-14 16:20:26 +00:00
|
|
|
* @deprecated 29.0.0 Use {@see self::SETTINGS_PERSONAL} instead
|
2017-05-19 10:11:07 +00:00
|
|
|
*/
|
2020-04-10 14:54:27 +00:00
|
|
|
public const KEY_PERSONAL_SETTINGS = 'personal';
|
2017-05-19 10:11:07 +00:00
|
|
|
|
|
|
|
/**
|
2017-06-26 09:03:41 +00:00
|
|
|
* @since 13.0.0
|
2024-02-14 16:20:26 +00:00
|
|
|
* @deprecated 29.0.0 Use {@see self::SETTINGS_PERSONAL} instead
|
2017-05-19 10:11:07 +00:00
|
|
|
*/
|
2020-10-05 13:12:57 +00:00
|
|
|
public const KEY_PERSONAL_SECTION = 'personal-section';
|
2017-05-19 10:11:07 +00:00
|
|
|
|
2016-08-08 21:31:26 +00:00
|
|
|
/**
|
2023-11-22 13:00:34 +00:00
|
|
|
* @since 29.0.0
|
|
|
|
*/
|
|
|
|
public const SETTINGS_ADMIN = 'admin';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @since 29.0.0
|
|
|
|
*/
|
|
|
|
public const SETTINGS_PERSONAL = 'personal';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @psalm-param self::SETTINGS_* $type
|
|
|
|
* @param class-string<IIconSection> $section
|
2018-01-29 12:14:56 +00:00
|
|
|
* @since 14.0.0
|
2016-08-08 21:31:26 +00:00
|
|
|
*/
|
2018-01-29 12:14:56 +00:00
|
|
|
public function registerSection(string $type, string $section);
|
2016-08-08 21:31:26 +00:00
|
|
|
|
2016-08-15 18:03:19 +00:00
|
|
|
/**
|
2023-11-22 13:00:34 +00:00
|
|
|
* @psalm-param self::SETTINGS_* $type
|
|
|
|
* @param class-string<ISettings> $setting
|
2018-01-29 12:14:56 +00:00
|
|
|
* @since 14.0.0
|
2016-08-15 22:52:41 +00:00
|
|
|
*/
|
2018-01-29 12:14:56 +00:00
|
|
|
public function registerSetting(string $type, string $setting);
|
2016-08-15 22:52:41 +00:00
|
|
|
|
2016-08-08 21:31:26 +00:00
|
|
|
/**
|
|
|
|
* returns a list of the admin sections
|
|
|
|
*
|
2023-11-22 13:00:34 +00:00
|
|
|
* @return array<int, list<IIconSection>> list of sections with priority as key
|
2016-08-11 17:28:24 +00:00
|
|
|
* @since 9.1.0
|
2016-08-08 21:31:26 +00:00
|
|
|
*/
|
2018-01-29 12:14:56 +00:00
|
|
|
public function getAdminSections(): array;
|
2016-08-08 21:31:26 +00:00
|
|
|
|
2017-05-15 23:40:36 +00:00
|
|
|
/**
|
|
|
|
* returns a list of the personal sections
|
|
|
|
*
|
2023-11-22 13:00:34 +00:00
|
|
|
* @return array<int, list<IIconSection>> list of sections with priority as key
|
2017-06-26 09:03:41 +00:00
|
|
|
* @since 13.0.0
|
2017-05-15 23:40:36 +00:00
|
|
|
*/
|
2018-01-29 12:14:56 +00:00
|
|
|
public function getPersonalSections(): array;
|
2017-05-15 23:40:36 +00:00
|
|
|
|
2016-08-08 21:31:26 +00:00
|
|
|
/**
|
|
|
|
* returns a list of the admin settings
|
|
|
|
*
|
|
|
|
* @param string $section the section id for which to load the settings
|
2019-05-22 08:48:51 +00:00
|
|
|
* @param bool $subAdminOnly only return settings sub admins are supposed to see (since 17.0.0)
|
2023-11-22 13:00:34 +00:00
|
|
|
* @return array<int, list<ISettings>> list of settings with priority as key
|
2016-08-11 17:28:24 +00:00
|
|
|
* @since 9.1.0
|
2016-08-08 21:31:26 +00:00
|
|
|
*/
|
2023-11-22 13:00:34 +00:00
|
|
|
public function getAdminSettings(string $section, bool $subAdminOnly = false): array;
|
2017-05-15 23:40:36 +00:00
|
|
|
|
2021-07-22 09:41:29 +00:00
|
|
|
/**
|
|
|
|
* Returns a list of admin settings that the given user can use for the give section
|
|
|
|
*
|
2024-09-27 19:40:30 +00:00
|
|
|
* @return array<int, list<ISettings>> List of admin-settings the user has access to, with priority as key.
|
2021-07-22 09:41:29 +00:00
|
|
|
* @since 23.0.0
|
|
|
|
*/
|
|
|
|
public function getAllowedAdminSettings(string $section, IUser $user): array;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of admin settings that the given user can use.
|
|
|
|
*
|
2023-11-22 13:00:34 +00:00
|
|
|
* @return list<ISettings> The array of admin settings there admin delegation is allowed.
|
2021-07-22 09:41:29 +00:00
|
|
|
* @since 23.0.0
|
|
|
|
*/
|
|
|
|
public function getAllAllowedAdminSettings(IUser $user): array;
|
|
|
|
|
2017-05-15 23:40:36 +00:00
|
|
|
/**
|
|
|
|
* returns a list of the personal settings
|
|
|
|
*
|
|
|
|
* @param string $section the section id for which to load the settings
|
2023-11-22 13:00:34 +00:00
|
|
|
* @return array<int, list<ISettings>> list of settings with priority as key
|
2017-06-26 09:03:41 +00:00
|
|
|
* @since 13.0.0
|
2017-05-15 23:40:36 +00:00
|
|
|
*/
|
2023-11-22 13:00:34 +00:00
|
|
|
public function getPersonalSettings(string $section): array;
|
2021-11-24 13:08:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a specific section by type and id
|
2023-11-22 13:00:34 +00:00
|
|
|
* @psalm-param self::SETTINGS_* $type
|
2021-11-24 13:08:16 +00:00
|
|
|
* @since 25.0.0
|
|
|
|
*/
|
|
|
|
public function getSection(string $type, string $sectionId): ?IIconSection;
|
2016-08-08 21:31:26 +00:00
|
|
|
}
|