IGroup.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Julius Härtl <jus@bitgrid.net>
  6. * @author Lukas Reschke <lukas@statuscode.ch>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Vincent Petry <pvince81@owncloud.com>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCP;
  27. /**
  28. * Interface IGroup
  29. *
  30. * @package OCP
  31. * @since 8.0.0
  32. */
  33. interface IGroup {
  34. /**
  35. * @return string
  36. * @since 8.0.0
  37. */
  38. public function getGID();
  39. /**
  40. * Returns the group display name
  41. *
  42. * @return string
  43. * @since 12.0.0
  44. */
  45. public function getDisplayName();
  46. /**
  47. * get all users in the group
  48. *
  49. * @return \OCP\IUser[]
  50. * @since 8.0.0
  51. */
  52. public function getUsers();
  53. /**
  54. * check if a user is in the group
  55. *
  56. * @param \OCP\IUser $user
  57. * @return bool
  58. * @since 8.0.0
  59. */
  60. public function inGroup(IUser $user);
  61. /**
  62. * add a user to the group
  63. *
  64. * @param \OCP\IUser $user
  65. * @since 8.0.0
  66. */
  67. public function addUser(IUser $user);
  68. /**
  69. * remove a user from the group
  70. *
  71. * @param \OCP\IUser $user
  72. * @since 8.0.0
  73. */
  74. public function removeUser($user);
  75. /**
  76. * search for users in the group by userid
  77. *
  78. * @param string $search
  79. * @param int $limit
  80. * @param int $offset
  81. * @return \OCP\IUser[]
  82. * @since 8.0.0
  83. */
  84. public function searchUsers($search, $limit = null, $offset = null);
  85. /**
  86. * returns the number of users matching the search string
  87. *
  88. * @param string $search
  89. * @return int|bool
  90. * @since 8.0.0
  91. */
  92. public function count($search = '');
  93. /**
  94. * returns the number of disabled users
  95. *
  96. * @return int|bool
  97. * @since 14.0.0
  98. */
  99. public function countDisabled();
  100. /**
  101. * search for users in the group by displayname
  102. *
  103. * @param string $search
  104. * @param int $limit
  105. * @param int $offset
  106. * @return \OCP\IUser[]
  107. * @since 8.0.0
  108. */
  109. public function searchDisplayName($search, $limit = null, $offset = null);
  110. /**
  111. * delete the group
  112. *
  113. * @return bool
  114. * @since 8.0.0
  115. */
  116. public function delete();
  117. /**
  118. * @return bool
  119. * @since 14.0.0
  120. */
  121. public function canRemoveUser();
  122. /**
  123. * @return bool
  124. * @since 14.0.0
  125. */
  126. public function canAddUser();
  127. }