You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
3.1 KiB

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