GroupInterface

interface OCP\GroupInterface
TODO actually this is a IGroupBackend
Implemented by:OCP\Group\Backend\ABackend OC\Group\Backend
Source:lib/public/GroupInterface.php#45

Constants

CREATE_GROUP = 0x1
actions that user backends can define
Source:lib/public/GroupInterface.php#50
DELETE_GROUP = 0x10
Source:lib/public/GroupInterface.php#51
ADD_TO_GROUP = 0x100
Source:lib/public/GroupInterface.php#52
REMOVE_FROM_GOUP = 0x1000
Source:lib/public/GroupInterface.php#53
REMOVE_FROM_GROUP = 0x1000
Source:lib/public/GroupInterface.php#54
COUNT_USERS = 0x100000
Source:lib/public/GroupInterface.php#56
GROUP_DETAILS = 0x1000000
Source:lib/public/GroupInterface.php#57
IS_ADMIN = 0x10000000
Source:lib/public/GroupInterface.php#61
Since:13.0.0

Methods

public OCP\GroupInterface::implementsActions($actions)
Check if backend implements actions
Source:

lib/public/GroupInterface.php#72

Parameters:
  • $actions (int) bitwise-or’ed actions
Returns:

bool

Since:

4.5.0 Returns the supported actions as int to be compared with \OC_Group_Backend::CREATE_GROUP etc.

public OCP\GroupInterface::inGroup($uid, $gid)
is user in group?
Source:

lib/public/GroupInterface.php#83

Parameters:
  • $uid (string) uid of the user
  • $gid (string) gid of the group
Returns:

bool

Since:

4.5.0 Checks whether the user is member of a group or not.

public OCP\GroupInterface::getUserGroups($uid)
Get all groups a user belongs to
Source:

lib/public/GroupInterface.php#94

Parameters:
  • $uid (string) Name of the user
Returns:

array an array of group names

Since:

4.5.0 This function fetches all groups a user belongs to. It does not check if the user exists at all.

public OCP\GroupInterface::getGroups($search="", $limit=-1, $offset=0)
get a list of all groups
Source:

lib/public/GroupInterface.php#106

Parameters:
  • $search (string)
  • $limit (int)
  • $offset (int)
Returns:

array an array of group names

Since:

4.5.0 Returns a list with all groups

public OCP\GroupInterface::groupExists($gid)
check if a group exists
Source:

lib/public/GroupInterface.php#114

Parameters:
  • $gid (string)
Returns:

bool

Since:

4.5.0

public OCP\GroupInterface::usersInGroup($gid, $search="", $limit=-1, $offset=0)
get a list of all users in a group
Source:

lib/public/GroupInterface.php#125

Parameters:
  • $gid (string)
  • $search (string)
  • $limit (int)
  • $offset (int)
Returns:

array an array of user ids

Since:

4.5.0