revokeAccess method
Future<void>
revokeAccess({
- required String folderPath,
- required MailboxType type,
- required PeerId targetPeerId,
Revoke access from a peer
Implementation
Future<void> revokeAccess({
required String folderPath,
required MailboxType type,
required PeerId targetPeerId,
}) async {
_logger.fine('Revoking access from ${targetPeerId.toBase58()} for $folderPath');
final address = MailboxAddress(
ownerId: host.id,
folderPath: folderPath,
type: type,
);
final request = RevokeAccessRequest(
address: address,
targetPeerId: targetPeerId,
);
final response = await _sendRequest(request);
if (!response.success) {
throw MailboxManagementError(
response.errorMessage ?? 'Failed to revoke access',
);
}
_logger.info('Revoked access from ${targetPeerId.toBase58()} for ${address.fullPath}');
}