setBucketPolicy method
Set the bucket policy on the specified bucket.
policy
is detailed here.
Implementation
Future<void> setBucketPolicy(
String bucket, [
Map<String, dynamic>? policy,
]) async {
MinioInvalidBucketNameError.check(bucket);
final method = policy != null ? 'PUT' : 'DELETE';
final payload = policy != null ? json.encode(policy) : '';
final resp = await _client.request(
method: method,
bucket: bucket,
resource: 'policy',
payload: payload,
);
validate(resp, expect: 204);
}