Skip to content

@ubstream/ubstream-node-client-sdk / Exports / LibrariesCollectionsAuthzClient

Class: LibrariesCollectionsAuthzClient

This class provides access to methods to manage authorizations of collections.

Hierarchy

  • AbstractClient

LibrariesCollectionsAuthzClient

Table of contents

Methods

Methods

listCollectionAuthz

listCollectionAuthz(libraryId, collectionId): Promise<IPublicLibraryCollectionAuthzData>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.

Returns

Promise<IPublicLibraryCollectionAuthzData>

Promise object representing all collection's authorizations.

Summary

Retrieve all collection's authorizations.

Example

const collectionAuthorizations = await client.libraries.collections.authz.listCollectionAuthz(
     "library_id",
     "collection_id",
);

listCollectionAuthzEverybody

listCollectionAuthzEverybody(libraryId, collectionId): Promise<IPublicLibraryCollectionAuthzEverybodyData>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.

Returns

Promise<IPublicLibraryCollectionAuthzEverybodyData>

Promise object representing collection's authorizations for everybody

Summary

Retrieve collection's authorizations for everybody.

Example

const everybodyAuthorizations = await client.libraries.collections.authz.listCollectionAuthzEverybody(
     "library_id",
     "collection_id",
)

listCollectionAuthzGroup

listCollectionAuthzGroup(libraryId, collectionId, groupId): Promise<IPublicLibraryCollectionAuthzGroupData>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.
groupId string The uuid of the targeted group mentioned in authorizations.

Returns

Promise<IPublicLibraryCollectionAuthzGroupData>

Promise object representing a group mentioned in collection's authorizations by its uuid its authorizations,.

Summary

Retrieve a group mentioned in collection's authorizations by its uuid.

Example

const groupAuthorizations = await client.libraries.collections.authz.listCollectionAuthzGroup(
     "library_id",
     "collection_id",
     "group_id"
);

listCollectionAuthzGroups

listCollectionAuthzGroups(libraryId, collectionId): Promise<IPublicLibraryCollectionAuthzGroupQuery>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.

Returns

Promise<IPublicLibraryCollectionAuthzGroupQuery>

Promise object representing all groups mentioned in collection's authorizations their authorizations,.

Summary

Retrieve all groups mentioned in collection's authorizations.

Example

const result = await client.libraries.collections.authz.listCollectionAuthzGroups(
     "library_id",
     "collection_id",
);
const groupsAuthorizations = result.$resources;

listCollectionAuthzUser

listCollectionAuthzUser(libraryId, collectionId, userId): Promise<IPublicLibraryCollectionAuthzUserData>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.
userId string The uuid of the targeted user mentioned in authorizations.

Returns

Promise<IPublicLibraryCollectionAuthzUserData>

Promise object representing a user mentioned in collection's authorizations by its uuid, and its authorizations.

Summary

Retrieve a user mentioned in collection's authorizations by its uuid.

Example

const userAuthorizations = await client.libraries.collections.authz.listCollectionAuthzUser(
     "library_id",
     "collection_id",
     "user_id"
);

listCollectionAuthzUsers

listCollectionAuthzUsers(libraryId, collectionId): Promise<IPublicLibraryCollectionAuthzUserQuery>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.

Returns

Promise<IPublicLibraryCollectionAuthzUserQuery>

Promise object representing all users mentioned in collection's authorizations, and their authorizations.

Summary

Retrieve all users mentioned in collection's authorizations.

Example

const result = await client.libraries.collections.authz.listCollectionAuthzUsers(
     "library_id",
     "collection_id"
);
const usersAuthorizations = result.$resources;

removeCollectionAuthzGroup

removeCollectionAuthzGroup(libraryId, collectionId, groupId, strategy): Promise<void | IPublicHttpResponseDataWithRequestId>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.
groupId string The uuid of the targeted group mentioned in authorizations.
strategy PublicAuthzPropagation The strategy to use during propagation.

Returns

Promise<void | IPublicHttpResponseDataWithRequestId>

Promise object with requestId if propagation have been applied.

Summary

Remove a group from a collection's authorizations.

Example

await client.libraries.collections.authz.removeCollectionAuthzGroup(
     "library_id",
     "collection_id",
     "group_id",
     PublicAuthzPropagation.DO_NOT_PROPAGATE,
);

removeCollectionAuthzUser

removeCollectionAuthzUser(libraryId, collectionId, userId, strategy): Promise<void | IPublicHttpResponseDataWithRequestId>

Parameters

Name Type Description
libraryId string The uuid of the targeted library.
collectionId string The uuid of the targeted collection.
userId string The uuid of the targeted user mentioned in authorizations.
strategy PublicAuthzPropagation The strategy to use during propagation.
  • MERGE : will apply delta on children entities authorizations.
  • DO_NOT_PROPAGATE : will not propagate authorizations to children. This is the default parameter.
  • Returns

    Promise<void | IPublicHttpResponseDataWithRequestId>

    Promise object with the requestId if propagation have been applied.

    Summary

    Remove a user from a collection's authorizations.

    Example

    await client.libraries.collections.authz.removeCollectionAuthzUser(
         "library_id",
         "collection_id",
         "user_id",
         PublicAuthzPropagation.DO_NOT_PROPAGATE,
    );
    

    setCollectionAuthz

    setCollectionAuthz(libraryId, collectionId, authzForm, strategy): Promise<IPublicLibraryCollectionAuthzData>

    Parameters

    Name Type Description
    libraryId string The uuid of the targeted library.
    collectionId string The uuid of the targeted collection.
    authzForm IPublicLibraryCollectionAuthzGridForm Authorizations to be modified.
    strategy PublicAuthzPropagationFull The strategy to use during propagation.

    Returns

    Promise<IPublicLibraryCollectionAuthzData>

    Promise object representing all collection's authorizations after modifications

    Summary

    Create or modify all the authorizations in the collection.

    Example

    const newCollectionAuthorizations = await client.libraries.collections.authz.setCollectionAuthz(
         "library_id",
         "collection_id",
         {
             "hash": "hash",
             "everybody": {
                 "scopes": []
             },
             "groups": [
                 {
                     "id": "group_id",
                     "name": "group_name",
                     "scopes": [
                         PublicLibraryCollectionScope.LIBRARY_COLLECTION_ACCESS,
                     ]
                 }
             ],
             "users": [
                 {
                     "id": "user_id",
                     "username": "user_username",
                     "displayName": "user_displayName",
                     "scopes": [
                         PublicLibraryCollectionScope.LIBRARY_COLLECTION_ACCESS,
                     ]
                 }
             ]
         },
         PublicAuthzPropagationFull.DO_NOT_PROPAGATE
    );
    

    setCollectionAuthzEverybody

    setCollectionAuthzEverybody(libraryId, collectionId, authzEverybodyForm, strategy): Promise<IPublicLibraryCollectionAuthzEverybodyData>

    Parameters

    Name Type Description
    libraryId string The uuid of the targeted library.
    collectionId string The uuid of the targeted collection.
    authzEverybodyForm IPublicLibraryCollectionAuthzForm Authorizations to be modified.
    strategy PublicAuthzPropagation The strategy to use during propagation.

    Returns

    Promise<IPublicLibraryCollectionAuthzEverybodyData>

    Promise object representing collection's authorizations for everybody after modifications

    Summary

    Create or modify authorization of everybody in a collection.

    Example

    const everybodyAuthz2 = await client.libraries.collections.authz.setCollectionAuthzEverybody(
         "library_id",
         "collection_id",
         {
             scopes: [
                 PublicLibraryCollectionScope.LIBRARY_COLLECTION_ACCESS,
                 PublicLibraryCollectionScope.LIBRARY_COLLECTION_EDIT,
             ],
         },
         PublicAuthzPropagationFull.DO_NOT_PROPAGATE
    )
    

    setCollectionAuthzGroup

    setCollectionAuthzGroup(libraryId, collectionId, groupId, authzGroupForm, strategy): Promise<IPublicLibraryCollectionAuthzGroupData>

    Parameters

    Name Type Description
    libraryId string The uuid of the targeted library.
    collectionId string The uuid of the targeted collection.
    groupId string The uuid of the targeted group mentioned in authorizations.
    authzGroupForm IPublicLibraryCollectionAuthzForm Authorizations to be modified.
    strategy PublicAuthzPropagation The strategy to use during propagation.
  • MERGE : will apply delta on children entities authorizations.
  • DO_NOT_PROPAGATE : will not propagate authorizations to children. This is the default parameter.
  • Returns

    Promise<IPublicLibraryCollectionAuthzGroupData>

    Promise object representing collection's authorization, after modifications, for a group by its uuid,.

    Summary

    Create or modify the authorizations of a group in a collection.

    Example

    const newGroupAuthorizations = await client.libraries.collections.authz.setCollectionAuthzGroup(
         "library_id",
         "collection_id",
         "group_id",
         {
             scopes: [
                  PublicLibraryCollectionScope.LIBRARY_COLLECTION_ACCESS,
                  PublicLibraryCollectionScope.LIBRARY_COLLECTION_EDIT,
             ],
         },
         PublicAuthzPropagationFull.DO_NOT_PROPAGATE,
    );
    

    setCollectionAuthzUser

    setCollectionAuthzUser(libraryId, collectionId, userId, authzUserForm, strategy): Promise<IPublicLibraryCollectionAuthzUserData>

    Parameters

    Name Type Description
    libraryId string The uuid of the targeted library.
    collectionId string The uuid of the targeted collection.
    userId string The uuid of the targeted user mentioned in authorizations.
    authzUserForm IPublicLibraryCollectionAuthzForm Authorizations to be modified.
    strategy PublicAuthzPropagation The strategy to use during propagation.

    Returns

    Promise<IPublicLibraryCollectionAuthzUserData>

    Promise object representing collection's authorization, after modifications, for a specified user

    Summary

    Create or modify the authorizations of a user in a collection.

    Example

    const newUserAuthorizations = await client.libraries.collections.authz.setCollectionAuthzUser(
         "library_id",
         "collection_id",
         "user_id",
         {
             scopes: [
                 PublicLibraryCollectionScope.LIBRARY_COLLECTION_ACCESS,
                 PublicLibraryCollectionScope.LIBRARY_COLLECTION_EDIT,
             ],
         },
         PublicAuthzPropagation.DO_NOT_PROPAGATE,
    );