Nextcloud PHP API (master)

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

Methods

addBackend()  : mixed
clearBackends()  : mixed
createGroup()  : IGroup|null
displayNamesInGroup()  : array<string|int, mixed>
get a list of all display names in a group
get()  : IGroup|null
getBackends()  : array<string|int, GroupInterface>
Get the active backends
getDisplayName()  : string|null
Get the display name of a Nextcloud group
getUserGroupIds()  : array<string|int, string>
getUserGroups()  : array<string|int, IGroup>
groupExists()  : bool
isAdmin()  : bool
Checks if a userId is in the admin group
isBackendUsed()  : bool
Checks whether a given backend is used
isDelegatedAdmin()  : bool
Checks if a userId is eligible to users administration delegation
isInGroup()  : bool
Checks if a userId is in a group
search()  : array<string|int, IGroup>

Methods

clearBackends()

public clearBackends() : mixed
Tags
since
8.0.0

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 = 0 ]) : array<string|int, mixed>
Parameters
$gid : string
$search : string = ''
$limit : int = -1
$offset : int = 0
Tags
since
8.0.0
Return values
array<string|int, mixed>

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

getDisplayName()

Get the display name of a Nextcloud group

public getDisplayName(string $groupId) : string|null
Parameters
$groupId : string
Tags
since
26.0.0
Return values
string|null

display name, if any

getUserGroupIds()

public getUserGroupIds(IUser $user) : array<string|int, string>
Parameters
$user : IUser
Tags
since
8.0.0
Return values
array<string|int, string>

with group names

getUserGroups()

public getUserGroups([IUser|null $user = null ]) : array<string|int, IGroup>
Parameters
$user : IUser|null = null
Tags
since
8.0.0
Return values
array<string|int, 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

isDelegatedAdmin()

Checks if a userId is eligible to users administration delegation

public isDelegatedAdmin(string $userId) : bool
Parameters
$userId : string
Tags
since
30.0.0
Return values
bool

if delegated admin

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|null $limit = null ][, int|null $offset = 0 ]) : array<string|int, IGroup>
Parameters
$search : string
$limit : int|null = null
$offset : int|null = 0
Tags
since
8.0.0
Return values
array<string|int, IGroup>

        
On this page

Search results