Nextcloud PHP API (stable18)

IGroupManager

Class Manager

Hooks available in scope \OC\Group:

  • preAddUser(\OC\Group\Group $group, \OC\User\User $user)
  • postAddUser(\OC\Group\Group $group, \OC\User\User $user)
  • preRemoveUser(\OC\Group\Group $group, \OC\User\User $user)
  • postRemoveUser(\OC\Group\Group $group, \OC\User\User $user)
  • preDelete(\OC\Group\Group $group)
  • postDelete(\OC\Group\Group $group)
  • preCreate(string $groupId)
  • postCreate(\OC\Group\Group $group)
Tags
since
8.0.0

Table of Contents

addBackend()  : mixed
clearBackends()  : mixed
createGroup()  : IGroup|null
displayNamesInGroup()  : array
get a list of all display names in a group
get()  : IGroup|null
getBackends()  : \OCP\GroupInterface[]
Get the active backends
getUserGroupIds()  : array
getUserGroups()  : \OCP\IGroup[]
groupExists()  : bool
isAdmin()  : bool
Checks if a userId is in the admin group
isBackendUsed()  : bool
Checks whether a given backend is used
isInGroup()  : bool
Checks if a userId is in a group
search()  : \OCP\IGroup[]

Methods

clearBackends()

public clearBackends() : mixed
Tags
since
8.0.0
Return values
mixed

createGroup()

public createGroup(string $gid) : IGroup|null
Parameters
$gid : string
Tags
since
8.0.0
Return values
IGroup|null

displayNamesInGroup()

get a list of all display names in a group

public displayNamesInGroup(string $gid[, string $search = '' ][, int $limit = -1 ], int $offset) : array
Parameters
$gid : string
$search : string = ''
$limit : int = -1
$offset : int
Tags
since
8.0.0
Return values
array

an array of display names (value) and user ids (key)

getBackends()

Get the active backends

public getBackends() : \OCP\GroupInterface[]
Tags
since
13.0.0
Return values
\OCP\GroupInterface[]

getUserGroupIds()

public getUserGroupIds(IUser $user) : array
Parameters
$user : IUser
Tags
since
8.0.0
Return values
array

with group names

getUserGroups()

public getUserGroups([IUser|null $user = null ]) : \OCP\IGroup[]
Parameters
$user : IUser|null = null
Tags
since
8.0.0
Return values
\OCP\IGroup[]

groupExists()

public groupExists(string $gid) : bool
Parameters
$gid : string
Tags
since
8.0.0
Return values
bool

isAdmin()

Checks if a userId is in the admin group

public isAdmin(string $userId) : bool
Parameters
$userId : string
Tags
since
8.0.0
Return values
bool

if admin

isBackendUsed()

Checks whether a given backend is used

public isBackendUsed(string $backendClass) : bool
Parameters
$backendClass : string

Full classname including complete namespace

Tags
since
8.1.0
Return values
bool

isInGroup()

Checks if a userId is in a group

public isInGroup(string $userId, string $group) : bool
Parameters
$userId : string
$group : string
Tags
since
8.0.0
Return values
bool

if in group

public search(string $search[, int $limit = null ][, int $offset = null ]) : \OCP\IGroup[]
Parameters
$search : string
$limit : int = null
$offset : int = null
Tags
since
8.0.0
Return values
\OCP\IGroup[]

Search results