ElvClient/AccessGroups

Methods for accessing and managing access groups

Source:

Methods

static LinkAccessGroupToOauth(
groupAddress,
kmsId,
oauthConfig
)

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

Parameters:
Name Type Description
groupAddress string

The address of the group

kmsId string

The ID of the KMS (or trust authority ID)

oauthConfig string | Object

The configuration for the OAuth settings

Source:

static ListAccessGroups() → Promise.<Array>

Retrieve a list of all available access groups

Returns: List of access groups
Source:

static UnlinkAccessGroupFromOauth(groupAddress)

Disable the OAuth linking on the specified access group

Parameters:
Name Type Description
groupAddress string

The address of the group

Source:

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

Get a list of addresses of managers of the specified group

Returns: List of manager addresses
Parameters:
Name Type Description
contractAddress

The address of the access group contract

Examples
async AccessGroupManagers({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934"
});


[
  "0x665aee2328fa4040e569e91be23faf5a82a6186c",
  "0x249e5764b14962387e82429152ca748d90130769"
]
async AccessGroupManagers({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934"
});


[
  "0x249e5764b14962387e82429152ca748d90130769"
]
Source:

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

Get a list of addresses of members of the specified group

Returns: List of member addresses
Parameters:
Name Type Description
contractAddress

The address of the access group contract

Examples
async AccessGroupMembers({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934"
});


[
  "0x665aee2328fa4040e569e91be23faf5a82a6186c",
  "0x249e5764b14962387e82429152ca748d90130769"
]
async AccessGroupMembers({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934"
});


[
  "0x249e5764b14962387e82429152ca748d90130769"
]
Source:

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

Returns the address of the owner of the specified content object

Returns: The account address of the owner
Parameters:
Name Type Description
libraryId string
Example
async AccessGroupOwner({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934"
});


"0x665aee2328fa4040e569e91be23faf5a82a6186c"
Source:

static 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:
Name Type Description
contractAddress string

Address of the access group contract

memberAddress string

Address of the manager to add

Examples
async AddAccessGroupManager({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "memberAddress": "665aee2328fa4040e569e91be23faf5a82a6186c"
});


"0x0bc415ddf84802dcfcbf8ab197216043074c0b1d55cf9fd34b8bb7d19bde6573"
async AddAccessGroupManager({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "memberAddress": "0x249e5764b14962387e82429152ca748d90130769"
});


"0xfe1930d0e78b0d9095fa0556bd8c3a67609674a3fe6f7f6d20f022a9201191ab"
Source:

static 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:
Name Type Description
contractAddress string

Address of the access group contract

memberAddress string

Address of the member to add

Examples
async AddAccessGroupMember({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "memberAddress": "0x665aee2328fa4040e569e91be23faf5a82a6186c"
});


"0x75df98adc7c1b479711b680218ee4430aee9003b33310fba142e9ad4814725d7"
async AddAccessGroupMember({
  "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "memberAddress": "0x249e5764b14962387e82429152ca748d90130769"
});


"0xf1d71dac4256ad8f5547ba8d10b2de6ce45237f53dd79958cd699d111f77dffb"
Source:

static AddContentLibraryGroup({
libraryId,
groupAddress,
permission
})

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

Parameters:
Name Type Description
libraryId string

The ID of the library

groupAddress string

The address of the group

permission string

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

Examples
async AddContentLibraryGroup({
  "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
  "groupAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "permission": "contributor"
});


<No Return Value>
async AddContentLibraryGroup({
  "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
  "groupAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "permission": "reviewer"
});


<No Return Value>
async AddContentLibraryGroup({
  "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
  "groupAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "permission": "accessor"
});


<No Return Value>
Source:

static AddContentObjectGroupPermission({
objectId,
groupAddress,
permission
})

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

Parameters:
Name Type Description
objectId string

The ID of the object

groupAddress string

The address of the group

permission string

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

Examples
async AddContentObjectGroupPermission({
  "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9",
  "groupAddress": "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd",
  "permission": "see"
});


{
  "decode": "<function>",
  "name": "RightsChanged",
  "signature": "RightsChanged(address,address,uint8)",
  "topic": "0x23dcae6acc296731e3679d01e7cd963988e5a372850a0a1db2b9b01539e19ff4",
  "values": {
    "0": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
    "1": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
    "2": 2,
    "principal": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
    "entity": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
    "aggregate": 2,
    "length": 3
  }
}
async AddContentObjectGroupPermission({
  "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9",
  "groupAddress": "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd",
  "permission": "access"
});


{
  "decode": "<function>",
  "name": "RightsChanged",
  "signature": "RightsChanged(address,address,uint8)",
  "topic": "0x23dcae6acc296731e3679d01e7cd963988e5a372850a0a1db2b9b01539e19ff4",
  "values": {
    "0": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
    "1": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
    "2": 22,
    "principal": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
    "entity": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
    "aggregate": 22,
    "length": 3
  }
}
async AddContentObjectGroupPermission({
  "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9",
  "groupAddress": "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd",
  "permission": "manage"
});


{
  "decode": "<function>",
  "name": "RightsChanged",
  "signature": "RightsChanged(address,address,uint8)",
  "topic": "0x23dcae6acc296731e3679d01e7cd963988e5a372850a0a1db2b9b01539e19ff4",
  "values": {
    "0": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
    "1": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
    "2": 222,
    "principal": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
    "entity": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
    "aggregate": 222,
    "length": 3
  }
}
async AddContentObjectGroupPermission({
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
  "groupAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
  "permission": "access"
});


{
  "decode": "<function>",
  "name": "RightsChanged",
  "signature": "RightsChanged(address,address,uint8)",
  "topic": "0x23dcae6acc296731e3679d01e7cd963988e5a372850a0a1db2b9b01539e19ff4",
  "values": {
    "0": "0x1770921fADA087576272cCCA2A30CC0F5Bbec934",
    "1": "0xFEa494Af0CFb6BBc257314F4c00850A5f03476d0",
    "2": 20,
    "principal": "0x1770921fADA087576272cCCA2A30CC0F5Bbec934",
    "entity": "0xFEa494Af0CFb6BBc257314F4c00850A5f03476d0",
    "aggregate": 20,
    "length": 3
  }
}
Source:

static ContentLibraryGroupPermissions({
libraryId,
permissionsoptional
})
→ 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:
    Name Type Attributes Description
    libraryId string

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

    permissions Array.<string> <optional>

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

    Examples
    async ContentLibraryGroupPermissions({
      "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
      "permissions": [
        "contributor"
      ]
    });
    
    
    {}
    async ContentLibraryGroupPermissions({
      "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
      "permissions": [
        "reviewer"
      ]
    });
    
    
    {}
    async ContentLibraryGroupPermissions({
      "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
      "permissions": [
        "accessor"
      ]
    });
    
    
    {}
    async ContentLibraryGroupPermissions({
      "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2"
    });
    
    
    {
      "0x1770921fada087576272ccca2a30cc0f5bbec934": [
        "accessor",
        "contributor",
        "reviewer"
      ]
    }
    async ContentLibraryGroupPermissions({
      "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
      "permissions": [
        "reviewer"
      ]
    });
    
    
    {
      "0x1770921fada087576272ccca2a30cc0f5bbec934": [
        "reviewer"
      ]
    }
    async ContentLibraryGroupPermissions({
      "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2"
    });
    
    
    {
      "0x1770921fada087576272ccca2a30cc0f5bbec934": [
        "accessor",
        "contributor"
      ]
    }
    Source:

    static 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:
    Name Type Description
    objectId string

    The ID of the object

    Examples
    async ContentObjectGroupPermissions({
      "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9"
    });
    
    
    {}
    async ContentObjectGroupPermissions({
      "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9"
    });
    
    
    {
      "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd": [
        "manage",
        "access",
        "see"
      ]
    }
    async ContentObjectGroupPermissions({
      "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9"
    });
    
    
    {
      "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd": [
        "access",
        "see"
      ]
    }
    Source:

    static CreateAccessGroup({
    nameoptional,
    descriptionoptional,
    metaoptional
    })
    → 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:
    Name Type Attributes Description
    name string <optional>

    Name of the access group

    description string <optional>

    Description for the access group

    meta object <optional>

    Metadata for the access group

    Examples
    async CreateAccessGroup({
      "name": "Test Access Group",
      "description": "Test Access Group Description",
      "metadata": {
        "group": "metadata"
      }
    });
    
    
    "0x1770921fada087576272ccca2a30cc0f5bbec934"
    async CreateAccessGroup({
      "name": "Test Object Permissions"
    });
    
    
    "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd"
    Source:

    static DeleteAccessGroup({contractAddress})

    NOT YET SUPPORTED - Delete an access group

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

    Parameters:
    Name Type Description
    contractAddress string

    The address of the access group contract

    Example
    async DeleteAccessGroup({
      "contractAddress": "0xc1afc5e29d872ebc4be5559593a48a4bba016556"
    });
    
    
    <No Return Value>
    Source:

    static 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:
    Name Type Description
    contractAddress string

    Address of the access group contract

    memberAddress string

    Address of the manager to remove

    Example
    async RemoveAccessGroupManager({
      "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
      "memberAddress": "0x665aee2328fa4040e569e91be23faf5a82a6186c"
    });
    
    
    "0xa614ad929cc3e7bc8e9419ecd2fd8306f2344d5b2a30dda5ed554df988252575"
    Source:

    static 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:
    Name Type Description
    contractAddress string

    Address of the access group contract

    memberAddress string

    Address of the member to remove

    Example
    async RemoveAccessGroupMember({
      "contractAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
      "memberAddress": "0x665aee2328fa4040e569e91be23faf5a82a6186c"
    });
    
    
    "0xd6e53e599dd4d78a7d09ab79f13c0afea536f218ac5b76a4d67ef212812b3b20"
    Source:

    static RemoveContentLibraryGroup({
    libraryId,
    groupAddress,
    permission
    })

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

    Parameters:
    Name Type Description
    libraryId string

    The ID of the library

    groupAddress string

    The address of the group

    permission string

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

    Example
    async RemoveContentLibraryGroup({
      "libraryId": "ilib3762veoskHQtAwoUZZRX26V2qKc2",
      "groupAddress": "0x1770921fada087576272ccca2a30cc0f5bbec934",
      "permission": "reviewer"
    });
    
    
    <No Return Value>
    Source:

    static RemoveContentObjectGroupPermission({
    objectId,
    groupAddress,
    permission
    })

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

    Parameters:
    Name Type Description
    objectId string

    The ID of the object

    groupAddress string

    The address of the group

    permission string

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

    Examples
    async RemoveContentObjectGroupPermission({
      "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9",
      "groupAddress": "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd",
      "permission": "manage"
    });
    
    
    {
      "decode": "<function>",
      "name": "RightsChanged",
      "signature": "RightsChanged(address,address,uint8)",
      "topic": "0x23dcae6acc296731e3679d01e7cd963988e5a372850a0a1db2b9b01539e19ff4",
      "values": {
        "0": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
        "1": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
        "2": 22,
        "principal": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
        "entity": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
        "aggregate": 22,
        "length": 3
      }
    }
    async RemoveContentObjectGroupPermission({
      "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9",
      "groupAddress": "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd",
      "permission": "access"
    });
    
    
    {
      "decode": "<function>",
      "name": "RightsChanged",
      "signature": "RightsChanged(address,address,uint8)",
      "topic": "0x23dcae6acc296731e3679d01e7cd963988e5a372850a0a1db2b9b01539e19ff4",
      "values": {
        "0": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
        "1": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
        "2": 2,
        "principal": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
        "entity": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
        "aggregate": 2,
        "length": 3
      }
    }
    async RemoveContentObjectGroupPermission({
      "objectId": "iq__36pNatWfPEBrbutaJJZPaio37cy9",
      "groupAddress": "0x7c9a679072f7320b5382577885e95a1cbf9bd0dd",
      "permission": "see"
    });
    
    
    {
      "decode": "<function>",
      "name": "RightsChanged",
      "signature": "RightsChanged(address,address,uint8)",
      "topic": "0x23dcae6acc296731e3679d01e7cd963988e5a372850a0a1db2b9b01539e19ff4",
      "values": {
        "0": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
        "1": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
        "2": 0,
        "principal": "0x7c9a679072F7320b5382577885e95a1cBF9bd0DD",
        "entity": "0x96c19e76Bd69052739c3E6Ef5aC7048B7fB65F34",
        "aggregate": 0,
        "length": 3
      }
    }
    Source: