indivo.views.shares package

Submodules

indivo.views.shares.shares_account module

indivo.views.shares.shares_account.account_permissions(request, account)

List the carenets that an account has access to.

Will return 200 OK with a list of carenets on success.

indivo.views.shares.shares_account.carenet_account_create(request, carenet)

Add an account to a carenet.

request.POST must contain:

  • account_id: The email of the account to share with.
  • write: Whether or not the account can write to the carenet. Can be 'true' or 'false'. This is currently unused, as carenets are read-only, however it must be provided anyways.

Will return 200 OK on success, 404 Not Found if the specified account_id doesn’t exist, or 400 Bad Request if either account_id or write is not in request.POST.

indivo.views.shares.shares_account.carenet_account_delete(request, account, carenet)

Remove an account from a carenet.

Will return 200 OK on success.

indivo.views.shares.shares_account.carenet_account_list(request, carenet)

List the accounts in a carenet.

Will return 200 OK with a list of accounts on success.

indivo.views.shares.shares_account.carenet_account_permissions(request, carenet, account)

List the permissions of an account within a carenet.

Currently, carenets are read-only and accounts can access all documents within a carenet, so this call returns static XML indicating blanket access.

Will return 200 OK with the static XML on success.

indivo.views.shares.shares_autoshare module

indivo.views.shares.shares_autoshare.autoshare_create(request, record, carenet)

Automatically share all documents of a certain type into a carenet.

request.POST must contain:

  • type: the document schema namespace to create an autoshare for

Will return 200 OK on sucess, 404 Not Found if the specified type doesn’t exist.

indivo.views.shares.shares_autoshare.autoshare_delete(request, record, carenet)

Remove an autoshare from a carenet.

request.POST must contain:

  • type: the document schema namespace to remove an autoshare for

This will effectively unshare all documents of type type from the carenet, except documents which were shared individually.

Will return 200 OK on sucess, 404 Not Found if the specified type doesn’t exist.

indivo.views.shares.shares_autoshare.autoshare_list(request, record)

For a single record, list all carenets that a given doctype is autoshared with.

request.GET must contain:

  • type: the document schema namespace to check autoshares for

Will return 200 OK with a list of carenets that have an autoshare set up for doctype type on success, 404 Not Found if the specified type doesn’t exist.

indivo.views.shares.shares_autoshare.autoshare_list_bytype_all(request, record)

For a single record, list all doctypes autoshared into carenets.

Will return 200 OK with a list of doctypes and the carenets that have an autoshare for each doctype on success.

indivo.views.shares.shares_autoshare.autoshare_revert(request, record, document_id, carenet)

Revert the document-sharing of a document in a carent to whatever rules are specified by autoshares. NOT IMPLEMENTED.

indivo.views.shares.shares_autoshare.carenet_nevershare(request, document_id)

indivo.views.shares.shares_carenet module

indivo.views.shares.shares_carenet.carenet_create(*args, **kwargs)

Create a new carenet for a record.

request.POST must contain:

  • name: the label for the new carenet.

Will return 200 OK with XML describing the new carenet on success, 400 Bad Request if name wasn’t passed or if a carenet named name already exists on this record.

indivo.views.shares.shares_carenet.carenet_delete(request, carenet)

Delete a carenet.

Will return 200 OK on success.

indivo.views.shares.shares_carenet.carenet_list(request, record)

List all carenets for a record.

Will return 200 OK with a list of carenets on success.

indivo.views.shares.shares_carenet.carenet_rename(*args, **kwargs)

Change a carenet’s name.

request.POST must contain:

  • name: The new name for the carenet.

Will return 200 OK with XML describing the renamed carenet on success, 400 Bad Request if name wasn’t passed or if a carenet named name already exists on this record.

indivo.views.shares.shares_document module

indivo.views.shares.shares_document.carenet_document(request, carenet, document_id)

Return a document from a carenet.

Will only return the document if it exists within the carenet.

Will return 200 OK with the document content on success, 404 Not Found if document_id is invalid or if the indicated document is not shared in carenet.

indivo.views.shares.shares_document.carenet_document_delete(request, carenet, record, document_id)

Unshare a document from a given carenet.

If there is an autoshare of document_id‘s type into carenet, this call creates an exception for document_id in carenet. If document_id was shared individually into carenet, this call removes it. If document_id is not shared in carenet at all, this call does nothing immediately.

In all cases, this call exempts document_id from any future autoshares into this carenet.

Will return 200 OK on success, 404 Not Found if document_id doesn’t exist or if document_id or carenet don’t belong to record.

indivo.views.shares.shares_document.carenet_document_list(request, *args, **kwargs)

List documents from a given carenet.

request.GET may contain:

  • type: The document schema type to filter on.

Returns both documents in the given carenet and documents with the same types as in the record’s autoshare, filtered by type if passed.

Will return 200 OK with a document list on success, 404 Not Found if type doesn’t exist.

indivo.views.shares.shares_document.carenet_document_placement(*args, **kwargs)

Place a document into a given carenet.

Will return 200 OK on success, 404 Not Found if document_id doesn’t exist or if document_id has a nevershare set on it.

indivo.views.shares.shares_document.carenet_record(request, carenet)

Get basic information about the record to which a carenet belongs.

For now, info is the record id, label, creation time, creator, contact, and demographics.

Will return 200 OK with XML about the record on success.

indivo.views.shares.shares_document.document_carenets(request, record, document_id)

List all the carenets into which a document has been shared.

Will return 200 OK with a list of carenets on success, 404 Not Found if document_id is invalid.

indivo.views.shares.shares_nevershare module

indivo.views.shares.shares_nevershare.document_remove_nevershare(request, record, document_id)

Remove the nevershare flag from a document.

If a document has was shared via autoshare or explicitly, then marked as nevershare, this call will reactivate all previously existing shares.

Will return 200 OK on success, 404 Not Found if document_id is invalid.

indivo.views.shares.shares_nevershare.document_set_nevershare(request, record, document_id)

Flag a document to never be shared, anywhere.

This overrides autoshares and existing shares, and prevents sharing the document in the future, until document_remove_nevershare() is called.

Will return 200 OK on success, 404 Not Found if document_id is invalid.

indivo.views.shares.shares_pha module

indivo.views.shares.shares_pha.carenet_app_permissions(request, carenet, pha)

Retrieve the permissions for an app within a carenet. NOT IMPLEMENTED.

Will return 200 OK always, without doing anything.

indivo.views.shares.shares_pha.carenet_apps_create(request, carenet, pha)

Add an app to a carenet

Read/write capability is determined by the user who uses the app, not by the app itself, so no permissions are assigned here.

Apps can only be added to carenets if they have already been shared with the carenet’s record (i.e. the user has agreed to use the app).

Autonomous apps cannot be added to carenets, as they require a full-record scope.

Will return 200 OK on success, 404 Not Found if there is no existing share between pha and carenet’s record, or 400 Bad Request if pha is autonomous.

indivo.views.shares.shares_pha.carenet_apps_delete(request, carenet, pha)

Remove an app from a given carenet.

Will return 200 OK on success, or if pha was never in carenet and no work needed to be done.

indivo.views.shares.shares_pha.carenet_apps_list(*args, **kwargs)

List Apps within a given carenet.

Will return 200 OK with manifests for the apps on success.

Module contents

Indivo Sharing Views.

The views that implement sharing API calls.