IPrincipal.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAVACL;
  4. use Sabre\DAV;
  5. /**
  6. * IPrincipal interface.
  7. *
  8. * Implement this interface to define your own principals
  9. *
  10. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  11. * @author Evert Pot (http://evertpot.com/)
  12. * @license http://sabre.io/license/ Modified BSD License
  13. */
  14. interface IPrincipal extends DAV\INode
  15. {
  16. /**
  17. * Returns a list of alternative urls for a principal.
  18. *
  19. * This can for example be an email address, or ldap url.
  20. *
  21. * @return array
  22. */
  23. public function getAlternateUriSet();
  24. /**
  25. * Returns the full principal url.
  26. *
  27. * @return string
  28. */
  29. public function getPrincipalUrl();
  30. /**
  31. * Returns the list of group members.
  32. *
  33. * If this principal is a group, this function should return
  34. * all member principal uri's for the group.
  35. *
  36. * @return array
  37. */
  38. public function getGroupMemberSet();
  39. /**
  40. * Returns the list of groups this principal is member of.
  41. *
  42. * If this principal is a member of a (list of) groups, this function
  43. * should return a list of principal uri's for it's members.
  44. *
  45. * @return array
  46. */
  47. public function getGroupMembership();
  48. /**
  49. * Sets a list of group members.
  50. *
  51. * If this principal is a group, this method sets all the group members.
  52. * The list of members is always overwritten, never appended to.
  53. *
  54. * This method should throw an exception if the members could not be set.
  55. */
  56. public function setGroupMemberSet(array $principals);
  57. /**
  58. * Returns the displayname.
  59. *
  60. * This should be a human readable name for the principal.
  61. * If none is available, return the nodename.
  62. *
  63. * @return string
  64. */
  65. public function getDisplayName();
  66. }