ndex_group_set_membership: Add or Update a Group Member

Description Usage Arguments Value REST query Note Examples

View source: R/ndex_groups.R

Description

Updates the membership corresponding to the GroupMembership type specified in the URL parameter.

Usage

1
ndex_group_set_membership(ndexcon, groupId, userId, type = "MEMBER")

Arguments

ndexcon

object of class NDExConnection linkndex_connect

groupId

character; unique ID (UUID) of the group

userId

character; unique ID (UUID) of the user

type

character (optional)("GROUPADMIN"|"MEMBER")(default: "MEMBER"); Type of group membership

Value

Empty string ("") on success, else error

REST query

PUT: ndex_config$api$user$membership$update

Note

Requires an authorized user! (ndex_connect with credentials)

Compatible to NDEx server version 2.0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Establish a server connection with credentials 
# ndexcon = ndex_connect('MyAccountName', 'MyPassword')
## Find user and get own id
# user = ndex_find_user_byName(ndexcon, 'MyAccountName')
# userId = user$externalId
## Find own groups and get one group id
# groups = ndex_user_list_groups(ndexcon, userId)
# groupId = groups[1,"externalId"]
## Find an other user and get the id
# user = ndex_find_user_byName(ndexcon, 'SomeOtherAccountName')
# userId = user$externalId
## Add other user to the group
# ndex_group_set_membership(ndexcon, groupId, userId)
## Update other user's group permission
# ndex_group_set_membership(ndexcon, groupId, userId, type='MEMBER')    ## same as before
## Make other user to group admin (lose own admin permission)
# ndex_group_set_membership(ndexcon, groupId, userId, type='GROUPADMIN')
NULL

ndexr documentation built on April 29, 2020, 5:20 a.m.