1
0

IShareable.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author Roeland Jago Douma <roeland@famdouma.nl>
  7. * @author Thomas Müller <thomas.mueller@tmit.eu>
  8. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. namespace OCA\DAV\DAV\Sharing;
  25. use Sabre\DAV\INode;
  26. /**
  27. * This interface represents a dav resource that can be shared with other users.
  28. *
  29. */
  30. interface IShareable extends INode {
  31. /**
  32. * Updates the list of shares.
  33. *
  34. * The first array is a list of people that are to be added to the
  35. * resource.
  36. *
  37. * Every element in the add array has the following properties:
  38. * * href - A url. Usually a mailto: address
  39. * * commonName - Usually a first and last name, or false
  40. * * readOnly - A boolean value
  41. *
  42. * Every element in the remove array is just the address string.
  43. *
  44. * @param list<array{href: string, commonName: string, readOnly: bool}> $add
  45. * @param list<string> $remove
  46. */
  47. public function updateShares(array $add, array $remove): void;
  48. /**
  49. * Returns the list of people whom this resource is shared with.
  50. *
  51. * Every element in this array should have the following properties:
  52. * * href - Often a mailto: address
  53. * * commonName - Optional, for example a first + last name
  54. * * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
  55. * * readOnly - boolean
  56. *
  57. * @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
  58. */
  59. public function getShares(): array;
  60. public function getResourceId(): int;
  61. /**
  62. * @return ?string
  63. */
  64. public function getOwner();
  65. }