listACL method

Future<List<ACLEntry>> listACL({
  1. required String folderPath,
  2. required MailboxType type,
})

List all ACL entries for a mailbox

Implementation

Future<List<ACLEntry>> listACL({
  required String folderPath,
  required MailboxType type,
}) async {
  _logger.fine('Listing ACL for $folderPath');

  final address = MailboxAddress(
    ownerId: host.id,
    folderPath: folderPath,
    type: type,
  );

  final request = ListACLRequest(address: address);

  final response = await _sendRequest(request);
  if (!response.success) {
    throw MailboxManagementError(
      response.errorMessage ?? 'Failed to list ACL',
    );
  }

  if (response.data == null) {
    return [];
  }

  return AdminFrame.decodeACLList(response.data as List<dynamic>);
}