()
| 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] |