listPermissions method
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.
May throw InternalServiceException.
May throw InvalidInputException.
May throw OperationTimeoutException.
Parameter catalogId :
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.
Parameter includeRelated :
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.
Parameter maxResults :
The maximum number of results to return.
Parameter nextToken :
A continuation token, if this is not the first call to retrieve this list.
Parameter principal :
Specifies a principal to filter the permissions returned.
Parameter resource :
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.
Parameter resourceType :
Specifies a resource type to filter the permissions returned.
Implementation
Future<ListPermissionsResponse> listPermissions({
String? catalogId,
String? includeRelated,
int? maxResults,
String? nextToken,
DataLakePrincipal? principal,
Resource? resource,
DataLakeResourceType? resourceType,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $payload = <String, dynamic>{
if (catalogId != null) 'CatalogId': catalogId,
if (includeRelated != null) 'IncludeRelated': includeRelated,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
if (principal != null) 'Principal': principal,
if (resource != null) 'Resource': resource,
if (resourceType != null) 'ResourceType': resourceType.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/ListPermissions',
exceptionFnMap: _exceptionFns,
);
return ListPermissionsResponse.fromJson(response);
}