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

Function printFileAcl

storage/printFileAcl.js:42–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected