AuthorizedAdminSetting.php 854 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\AppFramework\Http\Attribute;
  8. use Attribute;
  9. use OCP\Settings\IDelegatedSettings;
  10. /**
  11. * Attribute for controller methods that should be only accessible with
  12. * full admin or partial admin permissions.
  13. *
  14. * @since 27.0.0
  15. */
  16. #[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
  17. class AuthorizedAdminSetting {
  18. /**
  19. * @param class-string<IDelegatedSettings> $settings A settings section the user needs to be able to access
  20. * @since 27.0.0
  21. */
  22. public function __construct(
  23. protected string $settings
  24. ) {
  25. }
  26. /**
  27. *
  28. * @return class-string<IDelegatedSettings>
  29. * @since 27.0.0
  30. */
  31. public function getSettings(): string {
  32. return $this->settings;
  33. }
  34. }