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

Function iamGetPolicy

kms/iamGetPolicy.js:50–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 // const resourceName = client.keyRingPath(projectId, locationId, keyRingId);
49
50 async function iamGetPolicy() {
51 const [policy] = await client.getIamPolicy({
52 resource: resourceName,
53 });
54
55 for (const binding of policy.bindings) {
56 console.log(`Role: ${binding.role}`);
57 for (const member of binding.members) {
58 console.log(` - ${member}`);
59 }
60 }
61
62 return policy;
63 }
64
65 return iamGetPolicy();
66 // [END kms_iam_get_policy]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected