ndex_network_update_permission: Update Network Permission

View source: R/ndex_networks_ndex_properties.r

ndex_network_update_permissionR Documentation

Update Network Permission

Description

Updates the permission of a user specified by userid or group specified by groupid for the network

Usage

ndex_network_update_permission(
  ndexcon,
  networkId,
  user = NULL,
  group = NULL,
  permission
)

Arguments

ndexcon

object of class NDExConnection linkndex_connect

networkId

unique ID of the network

user

character (optional); uuid of the user. Only either user or group may be set!

group

character (optional); uuid of the group. Only either user or group may be set!

permission

character (optional)("READ"|"WRITE"|"ADMIN"); type of permission to be given. If granted admin permission, the current admin loses the admin status.

Value

1 integer on success, 0 if user/group allready has this permissions on the network

REST query

GET: ndex_config$api$network$permission$update

Note

Requires an authorized user! (ndex_connect with credentials)

Compatible to NDEx server version 1.3 and 2.0, but doesn't work for version 1.3

In version 1.3 the function only works for user permissions!

Examples

## Establish a server connection with credentials 
# ndexcon = ndex_connect('MyAccountName', 'MyPassword')
## Find one of your networks and get its UUID
# networks = ndex_find_networks(ndexcon, accountName='MyAccountName')
# networkId = networks[1,"externalId"]
## Get the UUID for a user and group
# someUserUuid = "uuuuuuuu-ssss-eeee-rrrr-111111111111"
# someGroupUuid = "ggggggg-rrrr-oooo-uuuu-pppppppppppp"
## Change the permissions
# ndex_network_update_permission(ndexcon, networkId, user=someUserUuid, 'WRITE')
# ndex_network_update_permission(ndexcon, networkId, group=someGroupUuid, 'READ')
## Set a new admin (lose own admin status)
# ndex_network_update_permission(ndexcon, networkId, user=someUserUuid, 'ADMIN')
NULL

frankkramer-lab/ndexr documentation built on Nov. 3, 2022, 6:57 a.m.