You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IManager.php 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author Lukas Reschke <lukas@statuscode.ch>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OCP\Settings;
  27. use OCP\IUser;
  28. /**
  29. * @since 9.1
  30. */
  31. interface IManager {
  32. /**
  33. * @since 9.1.0
  34. */
  35. public const KEY_ADMIN_SETTINGS = 'admin';
  36. /**
  37. * @since 9.1.0
  38. */
  39. public const KEY_ADMIN_SECTION = 'admin-section';
  40. /**
  41. * @since 13.0.0
  42. */
  43. public const KEY_PERSONAL_SETTINGS = 'personal';
  44. /**
  45. * @since 13.0.0
  46. */
  47. public const KEY_PERSONAL_SECTION = 'personal-section';
  48. /**
  49. * @param string $type 'admin-section' or 'personal-section'
  50. * @param string $section Class must implement OCP\Settings\ISection
  51. * @since 14.0.0
  52. */
  53. public function registerSection(string $type, string $section);
  54. /**
  55. * @param string $type 'admin' or 'personal'
  56. * @param string $setting Class must implement OCP\Settings\ISettings
  57. * @since 14.0.0
  58. */
  59. public function registerSetting(string $type, string $setting);
  60. /**
  61. * returns a list of the admin sections
  62. *
  63. * @return array<int, array<int, IIconSection>> array from IConSection[] where key is the priority
  64. * @since 9.1.0
  65. */
  66. public function getAdminSections(): array;
  67. /**
  68. * returns a list of the personal sections
  69. *
  70. * @return array array of ISection[] where key is the priority
  71. * @since 13.0.0
  72. */
  73. public function getPersonalSections(): array;
  74. /**
  75. * returns a list of the admin settings
  76. *
  77. * @param string $section the section id for which to load the settings
  78. * @param bool $subAdminOnly only return settings sub admins are supposed to see (since 17.0.0)
  79. * @return array<int, array<int, ISettings>> array of ISettings[] where key is the priority
  80. * @since 9.1.0
  81. */
  82. public function getAdminSettings($section, bool $subAdminOnly = false): array;
  83. /**
  84. * Returns a list of admin settings that the given user can use for the give section
  85. *
  86. * @return array<int, list<ISettings>> The array of admin settings there admin delegation is allowed.
  87. * @since 23.0.0
  88. */
  89. public function getAllowedAdminSettings(string $section, IUser $user): array;
  90. /**
  91. * Returns a list of admin settings that the given user can use.
  92. *
  93. * @return array<int, list<ISettings>> The array of admin settings there admin delegation is allowed.
  94. * @since 23.0.0
  95. */
  96. public function getAllAllowedAdminSettings(IUser $user): array;
  97. /**
  98. * returns a list of the personal settings
  99. *
  100. * @param string $section the section id for which to load the settings
  101. * @return array array of ISettings[] where key is the priority
  102. * @since 13.0.0
  103. */
  104. public function getPersonalSettings($section): array;
  105. }