ndex_user_list_groups: Get User's Group Memberships

View source: R/ndex_users.R

ndex_user_list_groupsR Documentation

Get User's Group Memberships

Description

Query finds groups for which the current user has the specified membership type. If the "type' parameter is omitted, all membership types will be returned. Returns a map which maps a group UUID to the membership type the authenticated user has.

Usage

ndex_user_list_groups(ndexcon, userId, type = NULL, start = NULL, size = NULL)

Arguments

ndexcon

object of class NDExConnection linkndex_connect

userId

character; unique ID (UUID) of the user

type

character (optional)("MEMBER"|"GROUPADMIN"); constrains the type of the returned membership. If not set (or NULL), all permission types will be returned.

start

integer (optional); specifies that the result is the nth page of the requested data.

size

integer (optional); specifies the number of data items in each page.

Value

List of permissions of that user or empty object

REST query

GET: ndex_config$api$user$group$list

Note

Requires an authorized user! (ndex_connect with credentials)

Compatible to NDEx server version 2.0

Examples

## Establish a server connection with credentials 
# ndexcon = ndex_connect('MyAccountName', 'MyPassword')
## Find user and get its id
# user = ndex_find_user_byName(ndexcon, 'MyAccountName')
# userId = user$externalId
## Find the user's groups and get one group id
# groups = ndex_user_list_groups(ndexcon, userId)
## $`ggggggg-rrrr-oooo-uuuu-pppppp111111`
## [1] "MEMBER"
##
## $`ggggggg-rrrr-oooo-uuuu-pppppp222222`
## [1] "GROUPADMIN"
# groupIds = names(groups)
## [1] "ggggggg-rrrr-oooo-uuuu-pppppp111111" "ggggggg-rrrr-oooo-uuuu-pppppp222222"
NULL

frankkramer-lab/ndexr documentation built on April 4, 2023, 7:19 p.m.