interface.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * @author Arthur Schiwon <blizzz@owncloud.com>
  4. * @author Joas Schilling <nickvergessen@owncloud.com>
  5. * @author Michael Gapczynski <GapczynskiM@gmail.com>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Robin Appelman <icewind@owncloud.com>
  8. * @author Robin McCorkell <rmccorkell@karoshi.org.uk>
  9. *
  10. * @copyright Copyright (c) 2015, ownCloud, Inc.
  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. interface OC_Group_Interface {
  27. /**
  28. * Check if backend implements actions
  29. * @param int $actions bitwise-or'ed actions
  30. * @return boolean
  31. *
  32. * Returns the supported actions as int to be
  33. * compared with \OC_Group_Backend::CREATE_GROUP etc.
  34. */
  35. public function implementsActions($actions);
  36. /**
  37. * is user in group?
  38. * @param string $uid uid of the user
  39. * @param string $gid gid of the group
  40. * @return bool
  41. *
  42. * Checks whether the user is member of a group or not.
  43. */
  44. public function inGroup($uid, $gid);
  45. /**
  46. * Get all groups a user belongs to
  47. * @param string $uid Name of the user
  48. * @return array an array of group names
  49. *
  50. * This function fetches all groups a user belongs to. It does not check
  51. * if the user exists at all.
  52. */
  53. public function getUserGroups($uid);
  54. /**
  55. * get a list of all groups
  56. * @param string $search
  57. * @param int $limit
  58. * @param int $offset
  59. * @return array an array of group names
  60. *
  61. * Returns a list with all groups
  62. */
  63. public function getGroups($search = '', $limit = -1, $offset = 0);
  64. /**
  65. * check if a group exists
  66. * @param string $gid
  67. * @return bool
  68. */
  69. public function groupExists($gid);
  70. /**
  71. * get a list of all users in a group
  72. * @param string $gid
  73. * @param string $search
  74. * @param int $limit
  75. * @param int $offset
  76. * @return array an array of user ids
  77. */
  78. public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0);
  79. }