IShareable.php 2.1 KB

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