IProvider.php 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Collaboration\Resources;
  8. use OCP\IUser;
  9. /**
  10. * @since 16.0.0
  11. */
  12. interface IProvider {
  13. /**
  14. * Get the resource type of the provider
  15. *
  16. * @return string
  17. * @since 16.0.0
  18. */
  19. public function getType(): string;
  20. /**
  21. * Get the rich object data of a resource
  22. *
  23. * @param IResource $resource
  24. * @return array
  25. * @since 16.0.0
  26. */
  27. public function getResourceRichObject(IResource $resource): array;
  28. /**
  29. * Can a user/guest access the collection
  30. *
  31. * @param IResource $resource
  32. * @param IUser|null $user
  33. * @return bool
  34. * @since 16.0.0
  35. */
  36. public function canAccessResource(IResource $resource, ?IUser $user): bool;
  37. }