ListUserPolicies() public method

Lists the names of the inline policies embedded in the specified IAM user.

An IAM user can also have managed policies attached to it. To list the managed policies that are attached to a user, use ListAttachedUserPolicies. For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide.

You can paginate the results using the MaxItems and Marker parameters. If there are no inline policies embedded with the specified user, the action returns an empty list.

/// The request was rejected because it referenced an entity that does not exist. The /// error message describes the entity. /// /// The request processing has failed because of an unknown error, exception or failure. ///
public ListUserPolicies ( ListUserPoliciesRequest request ) : ListUserPoliciesResponse
request ListUserPoliciesRequest Container for the necessary parameters to execute the ListUserPolicies service method.
return ListUserPoliciesResponse
Exemplo n.º 1
0
 public static void DeleteUserPoliciesForUser(AmazonIdentityManagementServiceClient client, string username)
 {
     ListUserPoliciesResponse response =
         client.ListUserPolicies(new ListUserPoliciesRequest() { UserName = username });
     foreach (string pName in response.PolicyNames)
     {
         client.DeleteUserPolicy(new DeleteUserPolicyRequest() { UserName = username, PolicyName = pName });
     }
 }