Skip to main content

Access Groups

Methods for accessing and managing access groups

AccessGroupManagers

AccessGroupManagers({ contractAddress }) → Promise.<Array.<string>>

Get a list of addresses of managers of the specified group

Returns: List of manager addresses

Parameters

NameTypeRequiredDescription
contractAddress

The address of the access group contract

AccessGroupMembers

AccessGroupMembers({ contractAddress }) → Promise.<Array.<string>>

Get a list of addresses of members of the specified group

Returns: List of member addresses

Parameters

NameTypeRequiredDescription
contractAddress

The address of the access group contract

AccessGroupOwner

AccessGroupOwner({ libraryId }) → Promise.<string>

Returns the address of the owner of the specified content object

Returns: The account address of the owner

Parameters

NameTypeRequiredDescription
libraryIdstring

AddAccessGroupManager

AddAccessGroupManager({
  contractAddress,
  memberAddress
}) → Promise.<string>

Add a manager to the access group at the specified contract address. This client's signer must be a manager of the access group.

Returns: The transaction hash of the call to the grantManagerAccess method

Parameters

NameTypeRequiredDescription
contractAddressstring

Address of the access group contract

memberAddressstring

Address of the manager to add

AddAccessGroupMember

AddAccessGroupMember({
  contractAddress,
  memberAddress
}) → Promise.<string>

Add a member to the access group at the specified contract address. This client's signer must be a manager of the access group.

Returns: The transaction hash of the call to the grantAccess method

Parameters

NameTypeRequiredDescription
contractAddressstring

Address of the access group contract

memberAddressstring

Address of the member to add

AddContentLibraryGroup

AddContentLibraryGroup({
  libraryId,
  groupAddress,
  permission
})

Add accessor, contributor or reviewer permissions for the specified group on the specified library

Parameters

NameTypeRequiredDescription
libraryIdstring

The ID of the library

groupAddressstring

The address of the group

permissionstring

The type of permission to add ("accessor", "contributor", "reviewer")

AddContentObjectGroupPermission

AddContentObjectGroupPermission({
  objectId,
  groupAddress,
  permission
})

Add a permission on the specified group for the specified object or content type

Parameters

NameTypeRequiredDescription
objectIdstring

The ID of the object

groupAddressstring

The address of the group

permissionstring

The type of permission to add ("see", "access", "manage")

ContentLibraryGroupPermissions

ContentLibraryGroupPermissions({
  libraryId,
  permissions // optional
}) → Promise.<Object>

List all of the groups with permissions on the specified library.

Returns: Object mapping group addresses to permissions, as an array Example: { "0x0": ["accessor", "contributor"], ...}

Parameters

NameTypeRequiredDescription
libraryIdstring

The ID of the library* @param {string} libraryId - The ID of the library

permissionsArray.<string>

Limit permission types. If not specified, all permissions will be included

ContentObjectGroupPermissions

ContentObjectGroupPermissions({ objectId }) → Promise.<Object>

List all of the groups with permissions on the specified object or content type

Returns: Object mapping group addresses to permissions, as an array Example: { "0x0": ["see", "access", "manage"], ...}

Parameters

NameTypeRequiredDescription
objectIdstring

The ID of the object

CreateAccessGroup

CreateAccessGroup({
  name, // optional
  description, // optional
  meta // optional
}) → Promise.<string>

Create a access group

A new access group contract is deployed from the content space

Returns: Contract address of created access group

Parameters

NameTypeRequiredDescription
namestring

Name of the access group

descriptionstring

Description for the access group

metaobject

Metadata for the access group

DeleteAccessGroup

DeleteAccessGroup({ contractAddress })

NOT YET SUPPORTED - Delete an access group

Calls the kill method on the specified access group's contract

Parameters

NameTypeRequiredDescription
contractAddressstring

The address of the access group contract

LinkAccessGroupToOauth

LinkAccessGroupToOauth(
  groupAddress,
  kmsId,
  oauthConfig
)

Link the specified group to an OAuth provider with the specified credentials

Parameters

NameTypeRequiredDescription
groupAddressstring

The address of the group

kmsIdstring

The ID of the KMS (or trust authority ID)

oauthConfigstring | Object

The configuration for the OAuth settings

ListAccessGroups

ListAccessGroups() → Promise.<Array>

Retrieve a list of all available access groups

Returns: List of access groups

RemoveAccessGroupManager

RemoveAccessGroupManager({
  contractAddress,
  memberAddress
}) → Promise.<string>

Remove a manager from the access group at the specified contract address. This client's signer must be a manager of the access group.

Returns: The transaction hash of the call to the revokeManagerAccess method

Parameters

NameTypeRequiredDescription
contractAddressstring

Address of the access group contract

memberAddressstring

Address of the manager to remove

RemoveAccessGroupMember

RemoveAccessGroupMember({
  contractAddress,
  memberAddress
}) → Promise.<string>

Remove a member from the access group at the specified contract address. This client's signer must be a manager of the access group.

Returns: The transaction hash of the call to the revokeAccess method

Parameters

NameTypeRequiredDescription
contractAddressstring

Address of the access group contract

memberAddressstring

Address of the member to remove

RemoveContentLibraryGroup

RemoveContentLibraryGroup({
  libraryId,
  groupAddress,
  permission
})

Remove accessor, contributor or reviewer permissions for the specified group on the specified library

Parameters

NameTypeRequiredDescription
libraryIdstring

The ID of the library

groupAddressstring

The address of the group

permissionstring

The type of permission to remove ("accessor", "contributor", "reviewer")

RemoveContentObjectGroupPermission

RemoveContentObjectGroupPermission({
  objectId,
  groupAddress,
  permission
})

Remove a permission on the specified group for the specified object or content type

Parameters

NameTypeRequiredDescription
objectIdstring

The ID of the object

groupAddressstring

The address of the group

permissionstring

The type of permission to remove ("see", "access", "manage")

UnlinkAccessGroupFromOauth

UnlinkAccessGroupFromOauth(groupAddress)

Disable the OAuth linking on the specified access group

Parameters

NameTypeRequiredDescription
groupAddressstring

The address of the group