bluesky_queueserver_api.zmq.REManagerAPI.permissions_set

REManagerAPI.permissions_set(user_group_permissions, *, lock_key=None)

Uploads the dictionary of user group permissions. If the uploaded permissions dictionary is valid and different from currently used permissions, then the new lists of allowed plans and devices are generated. The method has no effect if the uploaded permissions are identical to currently used permissions. The API request fails if the uploaded permissions dictionary does not pass validation.

Parameters:
user_group_permissions: dict

Dictionary, which contains user group permissions.

lock_key: str or None (optional)

The lock key enables access to the API when RE Manager queue is locked. If the parameter is not None, the key overrides the current lock key set by REManagerAPI.lock_key. See documentation on REMangerAPI.lock() for more information. Default: None.

Returns:
response: dict

Dictionary keys:

  • success: boolean - success of the request.

  • msg: str - error message in case the request is rejected by RE Manager or operation failed.

Raises:
RequestTimeoutError, RequestFailedError, HTTPRequestError, HTTPClientError, HTTPServerError

All exceptions raised by send_request API.

Examples

# Synchronous code (0MQ, HTTP)
response = RM.permissions_get()
permissions = response["user_group_permissions"]
# < modify permissions >
RM.permissions_get(permissions)

# Asynchronous code (0MQ, HTTP)
response = await RM.permissions_get()
permissions = response["user_group_permissions"]
# < modify permissions >
await RM.permissions_get(permissions)