Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

IGroup.php 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 <vincent@nextcloud.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. }