@eluvio/elv-client-js 3.1.77 → 3.1.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.77",
3
+ "version": "3.1.78",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.77",
3
+ "version": "3.1.78",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/ElvClient.js",
6
6
  "author": "Kevin Talmadge",
@@ -567,6 +567,17 @@ exports.CreateContentObject = async function({libraryId, objectId, options={}})
567
567
  }
568
568
 
569
569
  if(!objectId) {
570
+ const currentAccountAddress = await this.CurrentAccountAddress();
571
+ const canContribute = await this.CallContractMethod({
572
+ contractAddress: this.utils.HashToAddress(libraryId),
573
+ methodName: "canContribute",
574
+ methodArgs: [currentAccountAddress]
575
+ });
576
+
577
+ if(!canContribute) {
578
+ throw Error(`Current user does not have permission to create content in library ${libraryId}`);
579
+ }
580
+
570
581
  this.Log("Deploying contract...");
571
582
  const { contractAddress } = await this.authClient.CreateContentObject({libraryId, typeId});
572
583