Manages Identity and Access Management (IAM) policies.
Any implementation of an API that offers access control features
implements the google.iam.v1.IAMPolicy interface.
Data model
Access control is applied when a principal (user or service account), takes
some action on a resource exposed by a service. Resources, identified by
URI-like names, are the unit of access control specification. Service
implementations can choose the granularity of access control and the
supported permissions for their resources.
For example one database service may allow access control to be
specified only at the Table level, whereas another might allow access control
to also be specified at the Column level.
Policy Structure
See google.iam.v1.Policy
This is intentionally not a CRUD style API because access control policies
are created and deleted implicitly with the resources to which they are
attached.
public override TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)
Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.
public override Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)
Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eIAMPolicyClientImpl\u003c/code\u003e class, which is a client wrapper implementation for the Google Cloud Identity and Access Management (IAM) v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIAMPolicyClientImpl\u003c/code\u003e class inherits from \u003ccode\u003eIAMPolicyClient\u003c/code\u003e and is used to manage Identity and Access Management (IAM) policies.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the documentation is 3.4.0, with several previous versions available for reference, such as 3.3.0, 3.2.0, and others.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eIAMPolicyClientImpl\u003c/code\u003e offers methods for getting, setting, and testing permissions on resources, including \u003ccode\u003eGetIamPolicy\u003c/code\u003e, \u003ccode\u003eSetIamPolicy\u003c/code\u003e, and \u003ccode\u003eTestIamPermissions\u003c/code\u003e in both synchronous and asynchronous forms.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers a constructor that accepts a gRPC client, settings, and an optional logger, and includes a property that will retrieve the underlying gRPC client, named GrpcClient.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Identity and Access Management (IAM) v1 API - Class IAMPolicyClientImpl (3.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.4.0 (latest)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClientImpl)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Iam.V1/3.3.0/Google.Cloud.Iam.V1.IAMPolicyClientImpl)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Iam.V1/3.2.0/Google.Cloud.Iam.V1.IAMPolicyClientImpl)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Iam.V1/3.1.0/Google.Cloud.Iam.V1.IAMPolicyClientImpl)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Iam.V1/3.0.0/Google.Cloud.Iam.V1.IAMPolicyClientImpl)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Iam.V1/2.4.0/Google.Cloud.Iam.V1.IAMPolicyClientImpl)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Iam.V1/2.3.0/Google.Cloud.Iam.V1.IAMPolicyClientImpl)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Iam.V1/2.2.0/Google.Cloud.Iam.V1.IAMPolicyClientImpl) \n\n public sealed class IAMPolicyClientImpl : IAMPolicyClient\n\nReference documentation and code samples for the Google Cloud Identity and Access Management (IAM) v1 API class IAMPolicyClientImpl.\n\nIAMPolicy client wrapper implementation, for convenient use. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e [IAMPolicyClient](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient) \\\u003e IAMPolicyClientImpl \n\nInherited Members\n-----------------\n\n[IAMPolicyClient.DefaultEndpoint](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_DefaultEndpoint) \n[IAMPolicyClient.DefaultScopes](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_DefaultScopes) \n[IAMPolicyClient.ServiceMetadata](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_ServiceMetadata) \n[IAMPolicyClient.CreateAsync(CancellationToken)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_CreateAsync_System_Threading_CancellationToken_) \n[IAMPolicyClient.Create()](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_Create) \n[IAMPolicyClient.ShutdownDefaultChannelsAsync()](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_ShutdownDefaultChannelsAsync) \n[IAMPolicyClient.SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_SetIamPolicyAsync_Google_Cloud_Iam_V1_SetIamPolicyRequest_System_Threading_CancellationToken_) \n[IAMPolicyClient.GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_GetIamPolicyAsync_Google_Cloud_Iam_V1_GetIamPolicyRequest_System_Threading_CancellationToken_) \n[IAMPolicyClient.TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_TestIamPermissionsAsync_Google_Cloud_Iam_V1_TestIamPermissionsRequest_System_Threading_CancellationToken_) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Iam.V1](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Iam.V1.dll\n\nRemarks\n-------\n\nAPI Overview\n\nManages Identity and Access Management (IAM) policies.\n\nAny implementation of an API that offers access control features\nimplements the google.iam.v1.IAMPolicy interface.\n\nData model\n----------\n\nAccess control is applied when a principal (user or service account), takes\nsome action on a resource exposed by a service. Resources, identified by\nURI-like names, are the unit of access control specification. Service\nimplementations can choose the granularity of access control and the\nsupported permissions for their resources.\nFor example one database service may allow access control to be\nspecified only at the Table level, whereas another might allow access control\nto also be specified at the Column level.\n\nPolicy Structure\n----------------\n\nSee google.iam.v1.Policy\n\nThis is intentionally not a CRUD style API because access control policies\nare created and deleted implicitly with the resources to which they are\nattached.\n\nConstructors\n------------\n\n### IAMPolicyClientImpl(IAMPolicyClient, IAMPolicySettings, ILogger)\n\n public IAMPolicyClientImpl(IAMPolicy.IAMPolicyClient grpcClient, IAMPolicySettings settings, ILogger logger)\n\nConstructs a client wrapper for the IAMPolicy service, with the specified gRPC client and settings.\n\nProperties\n----------\n\n### GrpcClient\n\n public override IAMPolicy.IAMPolicyClient GrpcClient { get; }\n\nThe underlying gRPC IAMPolicy client\n\n**Overrides** \n[IAMPolicyClient.GrpcClient](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_GrpcClient)\n\nMethods\n-------\n\n### GetIamPolicy(GetIamPolicyRequest, CallSettings)\n\n public override Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)\n\nGets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.\n\n**Overrides** \n[IAMPolicyClient.GetIamPolicy(GetIamPolicyRequest, CallSettings)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_GetIamPolicy_Google_Cloud_Iam_V1_GetIamPolicyRequest_Google_Api_Gax_Grpc_CallSettings_)\n\n### GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)\n\n public override Task\u003cPolicy\u003e GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)\n\nGets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.\n\n**Overrides** \n[IAMPolicyClient.GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_GetIamPolicyAsync_Google_Cloud_Iam_V1_GetIamPolicyRequest_Google_Api_Gax_Grpc_CallSettings_)\n\n### SetIamPolicy(SetIamPolicyRequest, CallSettings)\n\n public override Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)\n\nSets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.\n\n**Overrides** \n[IAMPolicyClient.SetIamPolicy(SetIamPolicyRequest, CallSettings)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_SetIamPolicy_Google_Cloud_Iam_V1_SetIamPolicyRequest_Google_Api_Gax_Grpc_CallSettings_)\n\n### SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)\n\n public override Task\u003cPolicy\u003e SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)\n\nSets the access control policy on the specified resource. Replaces any\nexisting policy.\n\nCan return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.\n\n**Overrides** \n[IAMPolicyClient.SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_SetIamPolicyAsync_Google_Cloud_Iam_V1_SetIamPolicyRequest_Google_Api_Gax_Grpc_CallSettings_)\n\n### TestIamPermissions(TestIamPermissionsRequest, CallSettings)\n\n public override TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)\n\nReturns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a `NOT_FOUND` error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.\n\n**Overrides** \n[IAMPolicyClient.TestIamPermissions(TestIamPermissionsRequest, CallSettings)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_TestIamPermissions_Google_Cloud_Iam_V1_TestIamPermissionsRequest_Google_Api_Gax_Grpc_CallSettings_)\n\n### TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)\n\n public override Task\u003cTestIamPermissionsResponse\u003e TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)\n\nReturns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a `NOT_FOUND` error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.\n\n**Overrides** \n[IAMPolicyClient.TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)](/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient#Google_Cloud_Iam_V1_IAMPolicyClient_TestIamPermissionsAsync_Google_Cloud_Iam_V1_TestIamPermissionsRequest_Google_Api_Gax_Grpc_CallSettings_)"]]