MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / printBucketAcl

Function printBucketAcl

storage/printBucketAcl.js:39–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 const storage = new Storage();
38
39 async function printBucketAcl() {
40 try {
41 // Gets the ACL for the bucket
42 const [acls] = await storage.bucket(bucketName).acl.get();
43
44 acls.forEach(acl => {
45 console.log(`${acl.role}: ${acl.entity}`);
46 });
47 } catch (error) {
48 console.error(
49 'Error executing print bucket ACL:',
50 error.message || error
51 );
52 }
53 }
54 printBucketAcl();
55 // [END storage_print_bucket_acl]
56}

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected