ITeamResourceProvider.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCP\Teams;
  7. /**
  8. * Implement a provider of resources that are shared or owned by a team
  9. *
  10. * @since 29.0.0
  11. */
  12. interface ITeamResourceProvider {
  13. /**
  14. * Unique identifier used to identify the provider (app id)
  15. *
  16. * @since 29.0.0
  17. */
  18. public function getId(): string;
  19. /**
  20. * User visible name of the provider (app name)
  21. *
  22. * @since 29.0.0
  23. */
  24. public function getName(): string;
  25. /**
  26. * Svg icon to show next to the provider (app icon)
  27. *
  28. * @since 29.0.0
  29. */
  30. public function getIconSvg(): string;
  31. /**
  32. * Return all resources that are shared to the given team id for the current provider
  33. *
  34. * @param string $teamId
  35. * @return TeamResource[]
  36. * @since 29.0.0
  37. */
  38. public function getSharedWith(string $teamId): array;
  39. /**
  40. * Check if a resource is shared with the given team
  41. *
  42. * @since 29.0.0
  43. */
  44. public function isSharedWithTeam(string $teamId, string $resourceId): bool;
  45. /**
  46. * Return team ids that a resource is shared with or owned by
  47. *
  48. * @return string[]
  49. * @since 29.0.0
  50. */
  51. public function getTeamsForResource(string $resourceId): array;
  52. }