Skip to content

Sharing

Dataset access control.

nimbusimage.sharing.SharingAccessor

share(user_email_or_name, access='read')

Share this dataset with a user.

Grants (or revokes) access on the dataset folder and on each of its dataset views that the caller can write, plus those views' collections. A view is included only if the caller can write both the view and its collection: the server refuses a whole request that names anything else (403). Views and collections the caller can't write are left unchanged, as in the web app's Share dialog.

Parameters:

Name Type Description Default
user_email_or_name str

User's email or username.

required
access str

'read', 'write', 'admin', or 'remove'.

'read'

Raises:

Type Description
ValueError

If the caller lacks WRITE on the dataset, or the dataset has no dataset views (the server derives the dataset and collections from the views, so there is nothing to share through), or none the caller can write.

set_public(public=True)

Set whether this dataset is publicly accessible.

Also sets the public flag on the dataset's views and their collections that the caller owns (ADMIN); other users' views and collections are left unchanged. Requires ADMIN (owner) access on the dataset.

Returns:

Type Description
dict

The server's summary: dataset, public,

dict

datasetViewsUpdated and configurationsUpdated, and

dict

datasetViewsSkipped and configurationsSkipped for

dict

other users' items left in the other state.

get_access()

Get the access list for this dataset.

Returns:

Type Description
dict

``{"datasetId", "public", "users", "groups",

dict

"configurations", "writableViewIds", "currentUserLevel"}``;

dict

each user entry has id, login, name, email and

dict

level (0 read, 1 write, 2 admin). Each configuration

dict

carries the caller's currentUserLevel on it, and

dict

writableViewIds lists the views the caller can write.