interface.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * ownCloud - group interface
  4. *
  5. * @author Arthur Schiwon
  6. * @copyright 2012 Arthur Schiwon blizzz@owncloud.org
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. interface OC_Group_Interface {
  23. /**
  24. * @brief Check if backend implements actions
  25. * @param int $actions bitwise-or'ed actions
  26. * @return boolean
  27. *
  28. * Returns the supported actions as int to be
  29. * compared with OC_GROUP_BACKEND_CREATE_GROUP etc.
  30. */
  31. public function implementsActions($actions);
  32. /**
  33. * @brief is user in group?
  34. * @param string $uid uid of the user
  35. * @param string $gid gid of the group
  36. * @return bool
  37. *
  38. * Checks whether the user is member of a group or not.
  39. */
  40. public function inGroup($uid, $gid);
  41. /**
  42. * @brief Get all groups a user belongs to
  43. * @param string $uid Name of the user
  44. * @return array with group names
  45. *
  46. * This function fetches all groups a user belongs to. It does not check
  47. * if the user exists at all.
  48. */
  49. public function getUserGroups($uid);
  50. /**
  51. * @brief get a list of all groups
  52. * @param string $search
  53. * @param int $limit
  54. * @param int $offset
  55. * @return array with group names
  56. *
  57. * Returns a list with all groups
  58. */
  59. public function getGroups($search = '', $limit = -1, $offset = 0);
  60. /**
  61. * check if a group exists
  62. * @param string $gid
  63. * @return bool
  64. */
  65. public function groupExists($gid);
  66. /**
  67. * @brief get a list of all users in a group
  68. * @param string $gid
  69. * @param string $search
  70. * @param int $limit
  71. * @param int $offset
  72. * @return array with user ids
  73. */
  74. public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0);
  75. }