@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 +1 -1
- package/package.json +1 -1
- package/src/client/ContentManagement.js +11 -0
package/package-lock.json
CHANGED
package/package.json
CHANGED
|
@@ -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
|
|