Skip to content

list_permissions

list_permissions(
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
    principal: Optional[DataLakePrincipal] = None,
    resource_type: Optional[DataLakeResourceType] = None,
    resource: Optional[Resource] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[PageSize] = None,
    include_related: Optional[TrueFalseString] = None,
) -> ListPermissionsResponse

Returns a list of the principal permissions on the resource, filtered by the permissions of the caller. For example, if you are granted an ALTER permission, you are able to see only the principal permissions for ALTER.

This operation returns only those permissions that have been explicitly granted. If both Principal and Resource parameters are provided, the response returns effective permissions rather than the explicitly granted permissions.

For information about permissions, see Security and Access Control to Metadata and Data.

Parameters:

  • catalog_id (Optional[CatalogIdString], default: None ) –

    The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.

  • principal (Optional[DataLakePrincipal], default: None ) –

    Specifies a principal to filter the permissions returned.

  • resource_type (Optional[DataLakeResourceType], default: None ) –

    Specifies a resource type to filter the permissions returned.

  • resource (Optional[Resource], default: None ) –

    A resource where you will get a list of the principal permissions.

    This operation does not support getting privileges on a table with columns. Instead, call this operation on the table, and the operation returns the table and the table w columns.

  • next_token (Optional[Token], default: None ) –

    A continuation token, if this is not the first call to retrieve this list.

  • max_results (Optional[PageSize], default: None ) –

    The maximum number of results to return.

  • include_related (Optional[TrueFalseString], default: None ) –

    Indicates that related permissions should be included in the results when listing permissions on a table resource.

    Set the field to TRUE to show the cell filters on a table resource. Default is FALSE. The Principal parameter must not be specified when requesting cell filter information.

Raises:

Source code in docs_src/capo_lakeformation/_services/lake_formation.py
def list_permissions(
    self,
    *,
    config_overrides: Optional[LakeFormationClientConfig] = None,
    catalog_id: Optional[
        "capo_lakeformation.types.catalog_id_string.CatalogIdString"
    ] = None,
    principal: Optional[
        "capo_lakeformation.types.data_lake_principal.DataLakePrincipal"
    ] = None,
    resource_type: Optional[
        "capo_lakeformation.types.data_lake_resource_type.DataLakeResourceType"
    ] = None,
    resource: Optional["capo_lakeformation.types.resource.Resource"] = None,
    next_token: Optional["capo_lakeformation.types.token.Token"] = None,
    max_results: Optional["capo_lakeformation.types.page_size.PageSize"] = None,
    include_related: Optional[
        "capo_lakeformation.types.true_false_string.TrueFalseString"
    ] = None,
) -> "capo_lakeformation.types.list_permissions_response.ListPermissionsResponse":
    """<p>Returns a list of the principal permissions on the resource, filtered by the permissions of the caller. For example, if you are granted an ALTER permission, you are able to see only the principal permissions for ALTER.</p> <p>This operation returns only those permissions that have been explicitly granted. If both <code>Principal</code> and <code>Resource</code> parameters are provided, the response returns effective permissions rather than the explicitly granted permissions.</p> <p>For information about permissions, see <a href="https://docs.aws.amazon.com/lake-formation/latest/dg/security-data-access.html">Security and Access Control to Metadata and Data</a>.</p>

    Args:
        catalog_id: <p>The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment. </p>
        principal: <p>Specifies a principal to filter the permissions returned.</p>
        resource_type: <p>Specifies a resource type to filter the permissions returned.</p>
        resource: <p>A resource where you will get a list of the principal permissions.</p> <p>This operation does not support getting privileges on a table with columns. Instead, call this operation on the table, and the operation returns the table and the table w columns.</p>
        next_token: <p>A continuation token, if this is not the first call to retrieve this list.</p>
        max_results: <p>The maximum number of results to return.</p>
        include_related: <p>Indicates that related permissions should be included in the results when listing permissions on a table resource.</p> <p>Set the field to <code>TRUE</code> to show the cell filters on a table resource. Default is <code>FALSE</code>. The Principal parameter must not be specified when requesting cell filter information.</p>

    Raises:
        capo_lakeformation.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_lakeformation.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_lakeformation.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lakeformation.types.list_permissions_request.ListPermissionsRequest]",
    ) -> OperationResponse[
        "capo_lakeformation.types.list_permissions_response.ListPermissionsResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.list_permissions

        output, http_response = (
            capo_lakeformation._operations.aws_lake_formation.list_permissions.list_permissions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPermissions")
    )
    input_: capo_lakeformation.types.list_permissions_request.ListPermissionsRequest = {}
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id
    if principal is not None:
        input_["principal"] = principal
    if resource_type is not None:
        input_["resource_type"] = resource_type
    if resource is not None:
        input_["resource"] = resource
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if include_related is not None:
        input_["include_related"] = include_related

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output