GroupInterface

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

Constants

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

Methods

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

lib/public/GroupInterface.php#70

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#81

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#92

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#104

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#112

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#123

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

array an array of user ids

Since:

4.5.0