ITeamResourceProvider.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2024 Julius Härtl <jus@bitgrid.net>
  4. *
  5. * @author Julius Härtl <jus@bitgrid.net>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. namespace OCP\Teams;
  23. /**
  24. * Implement a provider of resources that are shared or owned by a team
  25. *
  26. * @since 29.0.0
  27. */
  28. interface ITeamResourceProvider {
  29. /**
  30. * Unique identifier used to identify the provider (app id)
  31. *
  32. * @since 29.0.0
  33. */
  34. public function getId(): string;
  35. /**
  36. * User visible name of the provider (app name)
  37. *
  38. * @since 29.0.0
  39. */
  40. public function getName(): string;
  41. /**
  42. * Svg icon to show next to the provider (app icon)
  43. *
  44. * @since 29.0.0
  45. */
  46. public function getIconSvg(): string;
  47. /**
  48. * Return all resources that are shared to the given team id for the current provider
  49. *
  50. * @param string $teamId
  51. * @return TeamResource[]
  52. * @since 29.0.0
  53. */
  54. public function getSharedWith(string $teamId): array;
  55. /**
  56. * Check if a resource is shared with the given team
  57. *
  58. * @since 29.0.0
  59. */
  60. public function isSharedWithTeam(string $teamId, string $resourceId): bool;
  61. /**
  62. * Return team ids that a resource is shared with or owned by
  63. *
  64. * @return string[]
  65. * @since 29.0.0
  66. */
  67. public function getTeamsForResource(string $resourceId): array;
  68. }