IShareable.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\DAV\DAV\Sharing;
  8. use Sabre\DAV\INode;
  9. /**
  10. * This interface represents a dav resource that can be shared with other users.
  11. *
  12. */
  13. interface IShareable extends INode {
  14. /**
  15. * Updates the list of shares.
  16. *
  17. * The first array is a list of people that are to be added to the
  18. * resource.
  19. *
  20. * Every element in the add array has the following properties:
  21. * * href - A url. Usually a mailto: address
  22. * * commonName - Usually a first and last name, or false
  23. * * readOnly - A boolean value
  24. *
  25. * Every element in the remove array is just the address string.
  26. *
  27. * @param list<array{href: string, commonName: string, readOnly: bool}> $add
  28. * @param list<string> $remove
  29. */
  30. public function updateShares(array $add, array $remove): void;
  31. /**
  32. * Returns the list of people whom this resource is shared with.
  33. *
  34. * Every element in this array should have the following properties:
  35. * * href - Often a mailto: address
  36. * * commonName - Optional, for example a first + last name
  37. * * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
  38. * * readOnly - boolean
  39. *
  40. * @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
  41. */
  42. public function getShares(): array;
  43. public function getResourceId(): int;
  44. /**
  45. * @return ?string
  46. */
  47. public function getOwner();
  48. }