revokePermissions method
- required List<
Permission> permissions, - required DataLakePrincipal principal,
- required Resource resource,
- String? catalogId,
- List<
Permission> ? permissionsWithGrantOption,
Revokes permissions to the principal to access metadata in the Data Catalog and data organized in underlying data storage such as Amazon S3.
May throw ConcurrentModificationException. May throw EntityNotFoundException. May throw InvalidInputException.
Parameter permissions
:
The permissions revoked to the principal on the resource. For information
about permissions, see Security
and Access Control to Metadata and Data.
Parameter principal
:
The principal to be revoked permissions on the resource.
Parameter resource
:
The resource to which permissions are to be revoked.
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 AWS Lake Formation environment.
Parameter permissionsWithGrantOption
:
Indicates a list of permissions for which to revoke the grant option
allowing the principal to pass permissions to other principals.
Implementation
Future<void> revokePermissions({
required List<Permission> permissions,
required DataLakePrincipal principal,
required Resource resource,
String? catalogId,
List<Permission>? permissionsWithGrantOption,
}) async {
ArgumentError.checkNotNull(permissions, 'permissions');
ArgumentError.checkNotNull(principal, 'principal');
ArgumentError.checkNotNull(resource, 'resource');
_s.validateStringLength(
'catalogId',
catalogId,
1,
255,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSLakeFormation.RevokePermissions'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Permissions': permissions.map((e) => e.toValue()).toList(),
'Principal': principal,
'Resource': resource,
if (catalogId != null) 'CatalogId': catalogId,
if (permissionsWithGrantOption != null)
'PermissionsWithGrantOption':
permissionsWithGrantOption.map((e) => e.toValue()).toList(),
},
);
}