1
0

IShareable.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Roeland Jago Douma <roeland@famdouma.nl>
  6. * @author Thomas Müller <thomas.mueller@tmit.eu>
  7. *
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  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, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCA\DAV\DAV\Sharing;
  24. use Sabre\DAV\INode;
  25. /**
  26. * This interface represents a dav resource that can be shared with other users.
  27. *
  28. */
  29. interface IShareable extends INode {
  30. /**
  31. * Updates the list of shares.
  32. *
  33. * The first array is a list of people that are to be added to the
  34. * resource.
  35. *
  36. * Every element in the add array has the following properties:
  37. * * href - A url. Usually a mailto: address
  38. * * commonName - Usually a first and last name, or false
  39. * * summary - A description of the share, can also be false
  40. * * readOnly - A boolean value
  41. *
  42. * Every element in the remove array is just the address string.
  43. *
  44. * @param array $add
  45. * @param array $remove
  46. * @return void
  47. */
  48. function updateShares(array $add, array $remove);
  49. /**
  50. * Returns the list of people whom this resource is shared with.
  51. *
  52. * Every element in this array should have the following properties:
  53. * * href - Often a mailto: address
  54. * * commonName - Optional, for example a first + last name
  55. * * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
  56. * * readOnly - boolean
  57. * * summary - Optional, a description for the share
  58. *
  59. * @return array
  60. */
  61. function getShares();
  62. /**
  63. * @return int
  64. */
  65. public function getResourceId();
  66. /**
  67. * @return string
  68. */
  69. public function getOwner();
  70. }